class MovingsignApi::DisplayMode

Text display mode setting.

Attributes

key[RW]

@return [Symbol] display mode constant (see attributes {#auto}, {#flash}, {#hold}, etc.)

Public Class Methods

display_mode(key, code) click to toggle source

@!visibility private

# File lib/movingsign_api/commands/internal/display_mode.rb, line 9
def self.display_mode(key, code)
  register key, code
end
new(mode) click to toggle source
# File lib/movingsign_api/commands/internal/display_mode.rb, line 49
def initialize(mode)
  @key = mode
end
parse(input) click to toggle source
# File lib/movingsign_api/commands/internal/display_mode.rb, line 53
def self.parse(input)
  if key = parse_to_key(input)
    self.new key
  else
    raise InvalidInputError, "Display mode '#{input}' is not valid."
  end
end