Class: Monolens::Core::Dig
- Inherits:
-
Object
- Object
- Monolens::Core::Dig
show all
- Includes:
- Lens
- Defined in:
- lib/monolens/stdlib/core/dig.rb
Instance Attribute Summary
Attributes included from Lens
#options
Instance Method Summary
collapse
Methods included from Lens
#fail!, included, #initialize
#fetch_on
Instance Method Details
#call(arg, world = {}) ⇒ Object
11
12
13
14
15
|
# File 'lib/monolens/stdlib/core/dig.rb', line 11
def call(arg, world = {})
option(:defn, []).inject(arg) do |memo, part|
dig_on(part, memo, world)
end
end
|