Class: DWML::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/dwml/location.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ Location

Returns a new instance of Location.


11
12
13
14
15
16
# File 'lib/dwml/location.rb', line 11

def initialize(element)
  @element = element

  extract_key
  extract_coords
end

Instance Attribute Details

#elementObject (readonly)

Returns the value of attribute element


9
10
11
# File 'lib/dwml/location.rb', line 9

def element
  @element
end

#latitudeObject (readonly)

Returns the value of attribute latitude


9
10
11
# File 'lib/dwml/location.rb', line 9

def latitude
  @latitude
end

#location_keyObject (readonly)

Returns the value of attribute location_key


9
10
11
# File 'lib/dwml/location.rb', line 9

def location_key
  @location_key
end

#longitudeObject (readonly)

Returns the value of attribute longitude


9
10
11
# File 'lib/dwml/location.rb', line 9

def longitude
  @longitude
end

Class Method Details

.extract(elements) ⇒ Object


4
5
6
# File 'lib/dwml/location.rb', line 4

def extract(elements)
  elements.map { |element| new(element) }
end