1 follower
Software Engineer | Tech Enthusiast | Cricketer
&., called “safe navigation operator”, allows to skip method call when receiver is nil. It returns nil and doesn't evaluate method's arguments if the call is skipped. The operator first appeared in Ruby 2.3. For instance, consider the Person class: c...
Hello, I use code snippets rather than long English paragraphs to explicate the working. Let's take a look at Ruby's try method:
dig and fetch are two powerful methods for manipulating a Hash object in Ruby. dig Pass the comma separated keys in the order of the nesting to dig the hash and obtain the value. fetch This method fetches value for key from the hash provided. fetc...