- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Mukul Latiyan has Published 474 Articles
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
326 Views
In Ruby, we can take the help of lambda functions when we want to use anonymous functions. They are also treated like objects in Ruby, as everything in Ruby is treated as objects.SyntaxThe syntax of declaring a lambda function is shown below.lambda = lambda {}Or, we can also make use ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
348 Views
In Ruby, the class whose objects can be ordered uses the Comparable mixin. Class definitions need to include an operator to compare receivers with each other. The operator will return either -1, 0, or 1.It returns -1 if the receiver is less than another object.If it is greater than another ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
740 Views
In this article, we will explore the two most widely used methods on arrays in Ruby. These are the reverse() method and the reverse! method.reverse() methodThe reverse() method in Ruby reverses the content of the array and returns a new array. Now, let's take a couple of examples to understand ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
1K+ Views
Inheritance is a key aspect of any OOP language. With the help of inheritance, we can reuse the methods that are defined on the parent class (also known as superclass) in the child class (also known as subclass).In Ruby, single class inheritance is supported, which means that one class can ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
120 Views
In Ruby, we have multiple types of iterators available to us. We will learn about the most common ones in this article, one by one.Each IteratorUsing this iterator, you can iterate over an array or a hash, returning each element as it is returned.Example 1Consider the code shown below# each ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
431 Views
In Ruby, we can create threads which have different states and a life cycle which denotes its time since it started till its ending. In this article, we will take a look at the life cycle of a thread in Ruby.Thread Life Cycle in RubyThe Thread life cycle is a ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
302 Views
Sometimes a situation arises where we would want to freeze the object instance so that it cannot be instantiated or modified and in Ruby, we can do that with the help of the freeze keyword.The approach is to invoke the Object#freeze statement.When we freeze an object, we are basically turning ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
210 Views
Range is a class in Ruby. Ruby ranges represent a set of values that have a beginning and an end. A range can be represented as a number, character, string, or object. A range is constructed with start_point...end_point, start_point...endpoint literals, or with ::new. It provides flexibility and reduces the size ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
2K+ Views
Unless StatementWe know that we can use the if statement when we want to run some code based on a condition that evaluates to True. Ruby also provides a special statement known as unless statement that can be used to run some code based on the condition that evaluates to ... Read More
![Mukul Latiyan](https://www.tutorialspoint.com/assets/profiles/308320/profile/60_124990-1617352847.jpg)
Mukul Latiyan
963 Views
Using BigDecimal, you can perform floating point decimal arithmetic with arbitrary precision. Let's try to understand the BigDecimal usecase with the help of an example. We will take two examples, where the first one will make use of no BigDecimal and in the second example, we will use BigDecimal.Consider the ... Read More