Module: Flatter::Mapper::Mapping::ClassMethods

Defined in:
lib/flatter/mapper/mapping.rb

Instance Method Summary collapse

Instance Method Details

#map(*args, **opts) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/flatter/mapper/mapping.rb', line 6

def map(*args, **opts)
  mappings            = opts.slice!(*mapping_options)
  mappings_from_array = Hash[*args.zip(args).flatten]
  mappings.merge!(mappings_from_array)

  define_mappings(mappings, opts)
end

#mapping_optionsObject



22
23
24
# File 'lib/flatter/mapper/mapping.rb', line 22

def mapping_options
  @@mapping_options ||= []
end

#mappingsObject



26
27
28
# File 'lib/flatter/mapper/mapping.rb', line 26

def mappings
  @mappings ||= {}
end

#mappings=(val) ⇒ Object



30
31
32
# File 'lib/flatter/mapper/mapping.rb', line 30

def mappings=(val)
  @mappings = val
end