Class: NMEAPlus::Message::AIS::VDMPayload::SubArea3::ShapePoint

Inherits:
Object
  • Object
show all
Defined in:
lib/nmea_plus/message/ais/vdm_payload/sub_area.rb

Overview

Container for bearing / distance

Instance Attribute Summary collapse

Instance Attribute Details

#bearingInteger #bearing=(Integer) ⇒ Object

Overloads:

  • #bearingInteger

    Returns:

    • (Integer)
  • #bearing=(Integer) ⇒ Object

    Sets bearing

    Parameters:

    • new (Integer)

      value



112
113
114
# File 'lib/nmea_plus/message/ais/vdm_payload/sub_area.rb', line 112

def bearing
  @bearing
end

#distanceInteger #distance=(Integer) ⇒ Object

Overloads:

  • #distanceInteger

    Returns:

    • (Integer)
  • #distance=(Integer) ⇒ Object

    Sets distance

    Parameters:

    • new (Integer)

      value



119
120
121
# File 'lib/nmea_plus/message/ais/vdm_payload/sub_area.rb', line 119

def distance
  @distance
end

#distance_metersInteger (readonly)

Returns The scaled distance in meters.

Returns:

  • (Integer)

    The scaled distance in meters



130
131
132
# File 'lib/nmea_plus/message/ais/vdm_payload/sub_area.rb', line 130

def distance_meters
  distance * (10**scale_factor)
end

#scale_factorInteger #scale_factor=(Integer) ⇒ Object

Overloads:

  • #scale_factorInteger

    Returns:

    • (Integer)
  • #scale_factor=(Integer) ⇒ Object

    Sets scale factor

    Parameters:

    • new (Integer)

      value



126
127
128
# File 'lib/nmea_plus/message/ais/vdm_payload/sub_area.rb', line 126

def scale_factor
  @scale_factor
end