Class: OsmImport::Table::Dsl

Inherits:
Struct
  • Object
show all
Defined in:
lib/osm_import/table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tableObject

Returns the value of attribute table

Returns:

  • (Object)

    the current value of 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