Module: Footing::NilClass
- Defined in:
- lib/extensions/nil_class.rb
Instance Method Summary collapse
-
#[](key) ⇒ Object
Similar to ActiveSupport’s #try added to NilClass.
Instance Method Details
#[](key) ⇒ Object
Similar to ActiveSupport’s #try added to NilClass. Calling [] on nil always returns nil. It becomes especially helpful when navigating through deeply nested Hashes.
13 14 15 |
# File 'lib/extensions/nil_class.rb', line 13 def [](key) nil end |