Method: FlatMap::Mapping#initialize
- Defined in:
- lib/flat_map/mapping.rb
#initialize(mapper, name, target_attribute, options = {}) ⇒ Mapping
Initialize a mapping, passing to it a mapper, which is a gateway to actual target, name, which is an external identifier, target_attribute, which is used to access actual information of the target, and options.
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/flat_map/mapping.rb', line 37 def initialize(mapper, name, target_attribute, = {}) @mapper = mapper @name = name @target_attribute = target_attribute @full_name = mapper.suffixed? ? :"#{@name}_#{mapper.suffix}" : name @multiparam = [:multiparam] fetch_reader() fetch_writer() end |