Module: Tripleloop::Util::NestedFetch

Defined in:
lib/tripleloop/util.rb

Instance Method Summary collapse

Instance Method Details

#get_in(*keys) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/tripleloop/util.rb', line 4

def get_in(*keys)
  return self if keys.empty?

  value = Util.with_nested_fetch(self[keys.shift])

  if value.respond_to?(:get_in) && !keys.empty?
    value.get_in(*keys)
  else
    value
  end
end