Class: LibTAD::Tides::StationInfo

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

Overview

Information about a station.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#distanceFloat (readonly)

Distance between request place and this station.

Returns:

  • (Float)


23
24
25
# File 'lib/types/tides/station_info.rb', line 23

def distance
  @distance
end

#latitudeFloat (readonly)

Latitude coordinates of the station.

Returns:

  • (Float)


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

def latitude
  @latitude
end

#longitudeFloat (readonly)

Longitude coordinates of the station.

Returns:

  • (Float)


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

def longitude
  @longitude
end

#nameString (readonly)

Station name.

Returns:

  • (String)


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

def name
  @name
end

#typeString (readonly)

Station type. Either reference or subordinate station.

Returns:

  • (String)


19
20
21
# File 'lib/types/tides/station_info.rb', line 19

def type
  @type
end