Class: NDFD::DWML::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/ndfd/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.


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

def initialize(element)
  @element = element

  extract_key
  extract_coords
end

Instance Attribute Details

#elementObject (readonly)

Returns the value of attribute element


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

def element
  @element
end

#latitudeObject (readonly)

Returns the value of attribute latitude


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

def latitude
  @latitude
end

#location_keyObject (readonly)

Returns the value of attribute location_key


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

def location_key
  @location_key
end

#longitudeObject (readonly)

Returns the value of attribute longitude


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

def longitude
  @longitude
end

Class Method Details

.extract(elements) ⇒ Object


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

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