0
what is the difference between include?() and cover? () in ruby.. please
for which each one used and is that any different in Return value...
1 Respuesta
0
Returns true if the given object is present in self (that is, if any object == anObject), false otherwise.
a = [ "a", "b", "c" ]
a.include?("b") #=> true
a.include?("x") #=> false
Returns true if obj is between beg and end, i.e beg <= obj <= end (or endexclusive when exclude_end? is true).
("a".."z").cover?("d") #=> true ("a".."z").cover?("5") #=> false