Class: LibTAD::Tides::Station
- Inherits:
-
Object
- Object
- LibTAD::Tides::Station
- Defined in:
- lib/types/tides/station.rb
Overview
Predicted data for a given station.
Instance Attribute Summary collapse
-
#matchparam ⇒ String
readonly
The part of the queried placeid that this location matches.
-
#result ⇒ Array<Tide>
readonly
Requested tidal information.
-
#source ⇒ StationInfo
readonly
The source station for the predicted tidal data.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Station
constructor
A new instance of Station.
Constructor Details
#initialize(hash) ⇒ Station
Returns a new instance of Station.
18 19 20 21 22 23 24 |
# File 'lib/types/tides/station.rb', line 18 def initialize(hash) @source = StationInfo.new hash.fetch('source', nil) @matchparam = hash.fetch('matchparam', nil) @result = hash.fetch('result', nil) &.map { |e| Tide.new(e) } end |
Instance Attribute Details
#matchparam ⇒ String (readonly)
The part of the queried placeid that this location matches.
11 12 13 |
# File 'lib/types/tides/station.rb', line 11 def matchparam @matchparam end |
#result ⇒ Array<Tide> (readonly)
Requested tidal information.
15 16 17 |
# File 'lib/types/tides/station.rb', line 15 def result @result end |
#source ⇒ StationInfo (readonly)
The source station for the predicted tidal data.
7 8 9 |
# File 'lib/types/tides/station.rb', line 7 def source @source end |