Class: Station

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Station

Returns a new instance of Station.



4
5
6
7
8
9
10
# File 'lib/station.rb', line 4

def initialize hash
  @description = hash['StationDesc']
  @latitude    = hash['StationLatitude']
  @longitude   = hash['StationLongitude']
  @code        = hash['StationCode']
  @id          = hash['StationId']
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



2
3
4
# File 'lib/station.rb', line 2

def code
  @code
end

#descriptionObject (readonly) Also known as: name

Returns the value of attribute description.



2
3
4
# File 'lib/station.rb', line 2

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/station.rb', line 2

def id
  @id
end

Instance Method Details

#locationObject



12
13
14
# File 'lib/station.rb', line 12

def location
  [@longitude,@latitude]
end