Polymorphism in Ruby
Polymorphism in Ruby The term polymorphism means having many forms. In Ruby, polymorphism is carried out by using Inheritance. Polymorphism is achieved by using method overriding. class Animal ...
Polymorphism in Ruby The term polymorphism means having many forms. In Ruby, polymorphism is carried out by using Inheritance. Polymorphism is achieved by using method overriding. class Animal ...
Inheritance in Ruby Inheritance is the feature of OOP in which characteristics & behaviours of one class inherits into another class. The class which is inheriting behaviour is called subclass...
Notes on various features and functions of Active Record Model Query Methods obj = User .where(email: 'info@mydomain.np') .where('id = 2') .where('id = ?', 2) .order(:tag_line) .order(t...
How to change all commits to have the same newly added author and committer? Go to appropriate branch and project directory and run the following command on console. git filter-branch -f --env-...
Senerio: User may not provide Name when creating profile, so user name is not compulsory But if Name is provided then minimum character should be 3 & max character should be 10 Solutions...
Lambdas and Proc Lambdas and Proc are block executing statement. Lambdas and Proc both are object of Proc. Lambdas and Proc are executed by call(). Lambda declaration x = lambda { p "This is l...
Engines are small applications which provides functionality to their host applications. A Rails application is a engine with Rails::Application class inheriting a lot of behaviour from Rails::Engin...
Pow is zero-config Rack server for Mac OS X. Your application will run on myapp.test without modifying /etc/hosts. Those who use GNU/Linux and installed Ruby and Rack gem Prax is usefull. It is a w...
An array is an ordered collection of elements that can be of any type. Each element in an array is referred to by an index. Array can have objects like integer, string, float, Fixnum, Hash, Symbol....
Ruby uses the case expression with one or more when conditions. After execution it returns one of the when statement or default else case. case gets.chomp when '1' puts "You have entered 1" whe...