Class: OsmImport::Table::Dsl
- Inherits:
-
Struct
- Object
- Struct
- OsmImport::Table::Dsl
- Defined in:
- lib/osm_import/table.rb
Instance Attribute Summary collapse
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
- #after_create(&block) ⇒ Object
- #after_import(&block) ⇒ Object
- #map(*args) ⇒ Object
- #with(*args) ⇒ Object
Instance Attribute Details
#table ⇒ Object
Returns the value of attribute table
24 25 26 |
# File 'lib/osm_import/table.rb', line 24 def table @table end |
Instance Method Details
#after_create(&block) ⇒ Object
40 41 42 |
# File 'lib/osm_import/table.rb', line 40 def after_create(&block) table.after_create_callbacks << block end |
#after_import(&block) ⇒ Object
44 45 46 |
# File 'lib/osm_import/table.rb', line 44 def after_import(&block) table.after_import_callbacks << block end |
#map(*args) ⇒ Object
36 37 38 |
# File 'lib/osm_import/table.rb', line 36 def map(*args) table.type_mapper.add_args(*args) end |
#with(*args) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/osm_import/table.rb', line 26 def with(*args) args.each do |arg| if arg.is_a? Hash arg.each(&method(:add_mapper)) else add_mapper arg, nil end end end |