class CowProxy::Struct

Wrapper class for Struct

Public Instance Methods

dig(key, *args) click to toggle source

Extracts the nested value specified by the sequence of idx objects by calling dig at each step, returning nil if any intermediate step is nil.

@return CowProxy wrapped value from wrapped object

# File lib/cow_proxy/struct.rb, line 8
def dig(key, *args)
  value = send(key)
  args.empty? ? value : value&.dig(*args)
end