Class: LibTAD::Tides::StationInfo
- Inherits:
-
Object
- Object
- LibTAD::Tides::StationInfo
- Defined in:
- lib/types/tides/station_info.rb
Overview
Information about a station.
Instance Attribute Summary collapse
-
#distance ⇒ Float
readonly
Distance between request place and this station.
-
#latitude ⇒ Float
readonly
Latitude coordinates of the station.
-
#longitude ⇒ Float
readonly
Longitude coordinates of the station.
-
#name ⇒ String
readonly
Station name.
-
#type ⇒ String
readonly
Station type.
Instance Method Summary collapse
-
#initialize(hash) ⇒ StationInfo
constructor
A new instance of StationInfo.
Constructor Details
#initialize(hash) ⇒ StationInfo
Returns a new instance of StationInfo.
25 26 27 28 29 30 31 |
# File 'lib/types/tides/station_info.rb', line 25 def initialize(hash) @name = hash.fetch('name', nil) @latitude = hash.fetch('latitude', nil) @longitude = hash.fetch('longitude', nil) @type = hash.fetch('type', nil) @distance = hash.fetch('distance', nil) end |
Instance Attribute Details
#distance ⇒ Float (readonly)
Distance between request place and this station.
23 24 25 |
# File 'lib/types/tides/station_info.rb', line 23 def distance @distance end |
#latitude ⇒ Float (readonly)
Latitude coordinates of the station.
11 12 13 |
# File 'lib/types/tides/station_info.rb', line 11 def latitude @latitude end |
#longitude ⇒ Float (readonly)
Longitude coordinates of the station.
15 16 17 |
# File 'lib/types/tides/station_info.rb', line 15 def longitude @longitude end |
#name ⇒ String (readonly)
Station name.
7 8 9 |
# File 'lib/types/tides/station_info.rb', line 7 def name @name end |
#type ⇒ String (readonly)
Station type. Either reference or subordinate station.
19 20 21 |
# File 'lib/types/tides/station_info.rb', line 19 def type @type end |