class Rozi::Waypoint

Represents a waypoint in Ozi Explorer

Constants

DISPLAY_FORMATS
PROPERTIES

Public Class Methods

new(*args, **kwargs) click to toggle source
Calls superclass method
# File lib/rozi/waypoints.rb, line 49
def initialize(*args, **kwargs)
  update(
    number: -1,
    name: "",
    latitude: 0.0,
    longitude: 0.0,
    date: nil,
    symbol: 0,
    display_format: :name_with_dot,
    fg_color: 0,
    bg_color: 65535,
    description: "",
    pointer_direction: 0,
    altitude: -777,
    font_size: 6,
    font_style: 0,
    symbol_size: 17
  )

  super
end

Public Instance Methods

bg_color=(color) click to toggle source

Sets the background color

# File lib/rozi/waypoints.rb, line 102
def bg_color=(color)
  @data[:bg_color] = interpret_color(color)
end
display_format(raw: false) click to toggle source

Returns the value of the display format property

@param [Boolean] raw If true, returns the raw value with no processing

Calls superclass method
# File lib/rozi/waypoints.rb, line 76
def display_format(raw: false)
  if raw
    super
  else
    DISPLAY_FORMATS.invert[super]
  end
end
display_format=(display_format) click to toggle source
# File lib/rozi/waypoints.rb, line 84
def display_format=(display_format)
  if display_format.is_a? Symbol
    @data[:display_format] = DISPLAY_FORMATS[display_format]
  else
    @data[:display_format] = display_format
  end
end
fg_color=(color) click to toggle source

Sets the foreground color

# File lib/rozi/waypoints.rb, line 95
def fg_color=(color)
  @data[:fg_color] = interpret_color(color)
end