Class: LibTAD::Tides::Station

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

Overview

Predicted data for a given station.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#matchparamString (readonly)

The part of the queried placeid that this location matches.

Returns:

  • (String)


11
12
13
# File 'lib/types/tides/station.rb', line 11

def matchparam
  @matchparam
end

#resultArray<Tide> (readonly)

Requested tidal information.

Returns:



15
16
17
# File 'lib/types/tides/station.rb', line 15

def result
  @result
end

#sourceStationInfo (readonly)

The source station for the predicted tidal data.

Returns:



7
8
9
# File 'lib/types/tides/station.rb', line 7

def source
  @source
end