Class: FlatMap::Mapping::Reader::Method
- Defined in:
- lib/flat_map/mapping/reader/method.rb
Overview
Method mapper calls a method, defined by the mapper, sending the mapping object to it as an argument.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Basic
Instance Method Summary collapse
-
#initialize(mapping, method) ⇒ Method
constructor
Initialize the reader with a
mappingand amethod. -
#read ⇒ Object
Send the
@methodto the mapping’s mapper, passing the mapping itself to it.
Constructor Details
#initialize(mapping, method) ⇒ Method
Initialize the reader with a mapping and a method.
12 13 14 |
# File 'lib/flat_map/mapping/reader/method.rb', line 12 def initialize(mapping, method) @mapping, @method = mapping, method end |
Instance Method Details
#read ⇒ Object
Send the @method to the mapping’s mapper, passing the mapping itself to it.
20 21 22 |
# File 'lib/flat_map/mapping/reader/method.rb', line 20 def read mapper.send(@method, mapping) end |