Class: Station
- Inherits:
-
Object
- Object
- Station
- Defined in:
- lib/station.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
(also: #name)
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Station
constructor
A new instance of Station.
- #location ⇒ Object
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
#code ⇒ Object (readonly)
Returns the value of attribute code.
2 3 4 |
# File 'lib/station.rb', line 2 def code @code end |
#description ⇒ Object (readonly) Also known as: name
Returns the value of attribute description.
2 3 4 |
# File 'lib/station.rb', line 2 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/station.rb', line 2 def id @id end |
Instance Method Details
#location ⇒ Object
12 13 14 |
# File 'lib/station.rb', line 12 def location [@longitude,@latitude] end |