Class: TwoWayMapper::Map
- Inherits:
-
Object
- Object
- TwoWayMapper::Map
- Defined in:
- lib/two_way_mapper/map.rb
Instance Method Summary collapse
-
#initialize ⇒ Map
constructor
A new instance of Map.
- #register(name) {|mapping| ... } ⇒ Object
Constructor Details
#initialize ⇒ Map
7 8 9 |
# File 'lib/two_way_mapper/map.rb', line 7 def initialize @maps = {} end |
Instance Method Details
#register(name) {|mapping| ... } ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/two_way_mapper/map.rb', line 11 def register(name) mapping = TwoWayMapper::Mapping.new yield mapping if block_given? @maps[name.to_sym] = mapping end |