Class: Location

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#eastingObject

Returns the value of attribute easting.



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

def easting
  @easting
end

#gazeteer_codeObject

Returns the value of attribute gazeteer_code.



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

def gazeteer_code
  @gazeteer_code
end

#identifierObject

Returns the value of attribute identifier.



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

def identifier
  @identifier
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#northingObject

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