Tag: Ruby
basic-enumerable-methods
Metadata 2022-06-03 18:42 | basic-enumerable-methods | Doriel Rivalet Content The do is optional in a for loop in Ruby and may cause issues if used in IRB...
conditional logic
Metadata 2022-05-26 01:17 conditional logic Content The only false values in Ruby are the values nil and false themselves If there is only one line of code to be evaluated inside the block, then you can rewrite the code to be more succinct and take up only one line:...
data-types
Metadata 2022-05-25 20:30 Data Types Content It’s important to keep in mind that when doing arithmetic with two integers in Ruby, the result will always be an integer....
debugging
Metadata 2022-06-02 03:27 | debugging | Doriel Rivalet Content repl stands for read evaluation print loop examples are irb and pry...
gemlist
Metadata 2022-06-06 06:33 | gemlist | Doriel Rivalet Content 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 *** LOCAL GEMS *** abbrev (default: 0....
hashes
Metadata 2022-05-31 05:02 | hashes | Doriel Rivalet| #hashes #ruby #the-odin-project Content As you can see, the values of a hash can be a number, a string, an array, or even another hash....
input-and-output
Metadata 2022-05-26 00:47 input and ouput Content puts appends a new line to the argument passed in, whereas print keeps things all on one line....
methods
Metadata 2022-06-01 22:28 | methods | Doriel Rivalet Content implicit return 1 2 3 4 5 def my_name "Joe Smith" end puts my_name #=> "Joe Smith" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 def even_odd(number) unless number....
nested-collections
Metadata 2022-06-04 18:50 | nested-collections | Doriel Rivalet Content use #dig to about errors when indexing arrays/hashes This first example uses the second optional argument for the default value....
oop
Metadata 2022-06-06 01:22 | oop | Doriel Rivalet Content lambdas are nameless methods/functions another name for properties are attributes classes have properties and objects have attributes?...