Method: HashExtensions::InstanceMethods#get
- Defined in:
- lib/eventhub/hash_extensions.rb
#get(arg) ⇒ Object
get value from provided key path, e.g. hash.get(%w(event_hub plate.queue1 retry_s)) “a” => { “b” => { “c” => { “value”}}}
9 10 11 12 13 14 |
# File 'lib/eventhub/hash_extensions.rb', line 9 def get(arg) path = arg.is_a?(String) ? arg.split('.') : arg path.inject(self,:[]) rescue NoMethodError return nil end |