Class: Location
- Inherits:
-
Object
- Object
- Location
- Defined in:
- lib/location.rb
Instance Attribute Summary collapse
-
#easting ⇒ Object
Returns the value of attribute easting.
-
#gazeteer_code ⇒ Object
Returns the value of attribute gazeteer_code.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#name ⇒ Object
Returns the value of attribute name.
-
#northing ⇒ Object
Returns the value of attribute northing.
Instance Method Summary collapse
-
#initialize(location_header, additional_location_information) ⇒ Location
constructor
A new instance of Location.
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(location_header, additional_location_information) ⇒ Location
Returns a new instance of Location.
5 6 7 8 9 10 11 |
# File 'lib/location.rb', line 5 def initialize(location_header, additional_location_information) @name = location_header[:full_location] @identifier = location_header[:record_identity] @easting = additional_location_information[:grid_reference_easting] @northing = additional_location_information[:grid_reference_northing] @gazeteer_code = location_header[:gazetteer_code] end |
Instance Attribute Details
#easting ⇒ Object
Returns the value of attribute easting.
3 4 5 |
# File 'lib/location.rb', line 3 def easting @easting end |
#gazeteer_code ⇒ Object
Returns the value of attribute gazeteer_code.
3 4 5 |
# File 'lib/location.rb', line 3 def gazeteer_code @gazeteer_code end |
#identifier ⇒ Object
Returns the value of attribute identifier.
3 4 5 |
# File 'lib/location.rb', line 3 def identifier @identifier end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/location.rb', line 3 def name @name end |
#northing ⇒ Object
Returns the value of attribute northing.
3 4 5 |
# File 'lib/location.rb', line 3 def northing @northing end |
Instance Method Details
#to_json(*a) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/location.rb', line 13 def to_json(*a) { :name => @name, :identifier => @identifier, :easting => @easting, :northing => @northing, :gazeteer_code => @gazeteer_code }.to_json(*a) end |