Class: Osmer::Mapper::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/osmer/mapper/base.rb

Direct Known Subclasses

Address, Area, Length, Name, String, Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, name, options = {}) ⇒ Base

Returns a new instance of Base.



7
8
9
10
# File 'lib/osmer/mapper/base.rb', line 7

def initialize(table, name, options = {})
  @table = table
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/osmer/mapper/base.rb', line 5

def name
  @name
end

#tableObject (readonly)

Returns the value of attribute table.



5
6
7
# File 'lib/osmer/mapper/base.rb', line 5

def table
  @table
end

Instance Method Details

#assignsObject



16
17
18
# File 'lib/osmer/mapper/base.rb', line 16

def assigns
  { name => "src_tags->'#{name}'" }
end

#conditionsObject



20
21
22
# File 'lib/osmer/mapper/base.rb', line 20

def conditions
  []
end

#fieldsObject



12
13
14
# File 'lib/osmer/mapper/base.rb', line 12

def fields
  { name => "TEXT" }
end

#indexesObject



24
25
26
# File 'lib/osmer/mapper/base.rb', line 24

def indexes
  {}
end