Class: OsmImport::Table

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

Defined Under Namespace

Classes: Dsl

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, name, &block) ⇒ Table

Returns a new instance of Table.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/osm_import/table.rb', line 7

def initialize(type, name, &block)
  require 'osm_import/mapper'

  @type = type.to_s.gsub(/s$/,'')
  @name = name
  @type_mapper = OsmImport::Mapper.new(:type, :type)
  @mappers = {}
  @after_create_callbacks = []
  @after_import_callbacks = []

  dsl.instance_eval(&block) if block
end

Instance Attribute Details

#after_create_callbacksObject (readonly)

Returns the value of attribute after_create_callbacks.



5
6
7
# File 'lib/osm_import/table.rb', line 5

def after_create_callbacks
  @after_create_callbacks
end

#after_import_callbacksObject (readonly)

Returns the value of attribute after_import_callbacks.



5
6
7
# File 'lib/osm_import/table.rb', line 5

def after_import_callbacks
  @after_import_callbacks
end

#mappersObject (readonly)

Returns the value of attribute mappers.



5
6
7
# File 'lib/osm_import/table.rb', line 5

def mappers
  @mappers
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/osm_import/table.rb', line 5

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/osm_import/table.rb', line 5

def type
  @type
end

#type_mapperObject (readonly)

Returns the value of attribute type_mapper.



5
6
7
# File 'lib/osm_import/table.rb', line 5

def type_mapper
  @type_mapper
end

Instance Method Details

#dslObject



20
21
22
# File 'lib/osm_import/table.rb', line 20

def dsl
  @dsl ||= Dsl.new self
end