Skip to content

Category Archives: Ruby

In this article, we will learn how to find maximum array element in Ruby. There are multiple ways to find maximum array element in Ruby.… Read More
We can send a block to our method and it can call that block multiple times. This can be done by sending a proc/lambda, but… Read More
In a Ruby class we may want to expose the instance variables (the variables that are defined prefixed by @ symbol) to other classes for… Read More
An exception is an object of class Exception or a child of that class. Exceptions occurs when the program reaches a state in its execution… Read More
An exception is an unwanted or unexpected event, which occurs during the execution of a program i.e at runtime, that disrupts the normal flow of… Read More
The concept of private, protected and public methods in Ruby is a bit different than it other languages like Java. In Ruby, it is all… Read More
The uniq() of enumerable is an inbuilt method in Ruby returns an array removing all the duplicates in the given enum. Syntax: enu.uniq Parameters: The… Read More
The drop_while() of enumerable is an inbuilt method in Ruby returns an array containing the rest elements after dropping elements up to, but not including,… Read More
The grep() of enumerable is an inbuilt method in Ruby returns an array of elements which contain every (element == pattern), of all the elements… Read More
The include?() of enumerable is an inbuilt method in Ruby returns a boolean value. It returns true if the enumerable contains the given elements, or… Read More
The reverse_each() of enumerable is an inbuilt method in Ruby returns the elements of the temporary array. The temporary array contains the enumerable in reverse… Read More
The drop() of enumerable is an inbuilt method in Ruby returns the rest elements in the enumerator after dropping the first N elements. Syntax: block.drop(N)… Read More
The minmax() of enumerable is an inbuilt method in Ruby returns an array containing two elements. It contains the minimum and the maximum value in… Read More
The sort() of enumerable is an inbuilt method in Ruby returns an array which contains the enum items in a sorted order. The comparisons are… Read More
The min() of enumerable is an inbuilt method in Ruby returns the minimum elements or an array containing the minimum N elements in the enumerable.… Read More

Start Your Coding Journey Now!