Method: Sofa::Mapping::ClassMethods#maps
- Defined in:
- lib/sofa/mapping.rb
#maps(hash = {}, &block) ⇒ Object
Class method to define mappings.
85 86 87 88 89 90 91 92 |
# File 'lib/sofa/mapping.rb', line 85
def maps(hash = {}, &block)
hash.each do |from, to|
method = to || from
@mappings[from.to_sym] = method
attr_reader method
@mappings_procs[method] = block
end
end
|