Class: DWML::Location
- Inherits:
-
Object
- Object
- DWML::Location
- Defined in:
- lib/dwml/location.rb
Instance Attribute Summary collapse
-
#element ⇒ Object
readonly
Returns the value of attribute element.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#location_key ⇒ Object
readonly
Returns the value of attribute location_key.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(element) ⇒ Location
constructor
A new instance of Location.
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
#element ⇒ Object (readonly)
Returns the value of attribute element.
9 10 11 |
# File 'lib/dwml/location.rb', line 9 def element @element end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
9 10 11 |
# File 'lib/dwml/location.rb', line 9 def latitude @latitude end |
#location_key ⇒ Object (readonly)
Returns the value of attribute location_key.
9 10 11 |
# File 'lib/dwml/location.rb', line 9 def location_key @location_key end |
#longitude ⇒ Object (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 |