class MovingsignApi::AlignMode

Align mode for a sign.

Valid values are:

Attributes

key[RW]

@return [Symbol] align mode (one of {#left}, {#right}, {#center})

Public Class Methods

new(key) click to toggle source

@param key [Symbol] one of the valid alignment keys

# File lib/movingsign_api/commands/internal/align_mode.rb, line 36
def initialize(key)
  @key = key
end
parse(input) click to toggle source

Parses an symbol or string into a valid {AlignMode} instance @return [AlignMode]

# File lib/movingsign_api/commands/internal/align_mode.rb, line 42
def self.parse(input)
  if key = parse_to_key(input)
    self.new key
  else
    raise InvalidInputError, "Align mode '#{input}' is invalid."
  end
end

Protected Class Methods

align_mode(key, code) click to toggle source

Registers a specific align mode key and value combo

# File lib/movingsign_api/commands/internal/align_mode.rb, line 19
def self.align_mode(key, code)
  register key, code
end