Class: Monolens::Object::Values
- Inherits:
-
Object
- Object
- Monolens::Object::Values
- Includes:
- Lens
- Defined in:
- lib/monolens/object/values.rb
Instance Attribute Summary
Attributes included from Lens
Instance Method Summary collapse
- #call(arg, *rest) ⇒ Object
-
#initialize(lens) ⇒ Values
constructor
A new instance of Values.
Methods included from Lens
#fetch_on, #is_array!, #is_enumerable!, #is_hash!, #is_string!, #option
Constructor Details
Instance Method Details
#call(arg, *rest) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/monolens/object/values.rb', line 11 def call(arg, *rest) is_hash!(arg) dup = arg.dup arg.each_pair do |attr, value| dup[attr] = @lens.call(value) end dup end |