
Difference between .nil?, .blank? and .empty in Ruby?
Answer 1 In Ruby, nil in an object (a single instance of the class NilClass) so methods can be called on it. nil? is a standard method in Ruby that can be called on all objects and returns true for the nil object and false for anything else. emp...
The map method takes an enumerable object and a block, and runs the block for each element, outputting each returned value from the block (the original object is unchanged unless you use map!): [1, 2, 3].map { |n| n * n } #=> [1, 4, 9] Array ...
Download Ruby and install Check ruby installation: ruby -e "puts 1+1" -> 2 irb - for interactive ruby commands Download devkit for corresponding ruby version and extract to c:\devkit Browse to c:\devkit and run this: ruby dk.rb init type...