There are multiple ways of getting ruby.
However, you can also use solutions like RVM or rbenv to manage multiple and/or more recent ruby versions at once easily. For more information, see the official documentation.
#methodon the object, for example
"hello".method(:length). You obtain a
methodobject which behaves like a
Procwhich you can pass to other functions.
They refer to equivalent as booleans. Boolean is a type which can only
take two values:
When we use the terms "truthy" and "falsy", we refer to the equivalent as a
boolean value that an expression will have, which is used by control flow statements like
while and filtering methods like
Only two values are falsy, meaning that they will be interpreted as
false. Any other value, including
0, will be truthy and be treated as
|| operator returns the argument which is truthy. In this
"b" == "a" evaluates to false, but "b" evaluates to true, so "b" is returned.
See also the "What does "truthy" and "falsy" means?" answer.