Class: MovingsignApi::DisplayMode

Inherits:
Object
  • Object
show all
Includes:
PrettyKeyable
Defined in:
lib/movingsign_api/commands/internal/display_mode.rb

Overview

Text display mode setting.

Display Mode Constants collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mode) ⇒ DisplayMode

Returns a new instance of DisplayMode.



49
50
51
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 49

def initialize(mode)
  @key = mode
end

Instance Attribute Details

#autoSymbol (readonly)

Display mode auto (protocol display mode ‘A’)

Returns:

  • (Symbol)

    :auto



18
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 18

display_mode :auto, 'A'

#clockSymbol (readonly)

Display mode clock (protocol display mode ‘Z’)

Returns:

  • (Symbol)

    :clock



43
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 43

display_mode :clock, 'Z'

#cyclecolorSymbol (readonly)

Display mode cyclecolor (protocol display mode ‘Y’)

Returns:

  • (Symbol)

    :cyclecolor



42
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 42

display_mode :cyclecolor, 'Y'

#flashSymbol (readonly)

Display mode flash (protocol display mode ‘B’)

Returns:

  • (Symbol)

    :flash



19
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 19

display_mode :flash, 'B'

#holdSymbol (readonly)

Display mode hold (protocol display mode ‘C’)

Returns:

  • (Symbol)

    :hold



20
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 20

display_mode :hold, 'C'

#interlockSymbol (readonly)

Display mode interlock (protocol display mode ‘D’)

Returns:

  • (Symbol)

    :interlock



21
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 21

display_mode :interlock, 'D'

#keySymbol

Returns display mode constant (see attributes #auto, #flash, #hold, etc.).

Returns:

  • (Symbol)

    display mode constant (see attributes #auto, #flash, #hold, etc.)



47
48
49
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 47

def key
  @key
end

#rolldownSymbol (readonly)

Display mode rolldown (protocol display mode ‘E’)

Returns:

  • (Symbol)

    :rolldown



22
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 22

display_mode :rolldown, 'E'

#rollinSymbol (readonly)

Display mode rollin (protocol display mode ‘G’)

Returns:

  • (Symbol)

    :rollin



24
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 24

display_mode :rollin, 'G'

#rollleftSymbol (readonly)

Display mode rollleft (protocol display mode ‘I’)

Returns:

  • (Symbol)

    :rollleft



26
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 26

display_mode :rollleft, 'I'

#rolloutSymbol (readonly)

Display mode rollout (protocol display mode ‘H’)

Returns:

  • (Symbol)

    :rollout



25
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 25

display_mode :rollout, 'H'

#rollrightSymbol (readonly)

Display mode rollright (protocol display mode ‘J’)

Returns:

  • (Symbol)

    :rollright



27
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 27

display_mode :rollright, 'J'

#rollupSymbol (readonly)

Display mode rollup (protocol display mode ‘F’)

Returns:

  • (Symbol)

    :rollup



23
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 23

display_mode :rollup, 'F'

#rotateSymbol (readonly)

Display mode rotate (protocol display mode ‘K’)

Returns:

  • (Symbol)

    :rotate



28
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 28

display_mode :rotate, 'K'

#slideSymbol (readonly)

Display mode slide (protocol display mode ‘L’)

Returns:

  • (Symbol)

    :slide



29
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 29

display_mode :slide, 'L'

#snowSymbol (readonly)

Display mode snow (protocol display mode ‘M’)

Returns:

  • (Symbol)

    :snow



30
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 30

display_mode :snow, 'M'

#sparkleSymbol (readonly)

Display mode sparkle (protocol display mode ‘N’)

Returns:

  • (Symbol)

    :sparkle



31
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 31

display_mode :sparkle, 'N'

#spraySymbol (readonly)

Display mode spray (protocol display mode ‘O’)

Returns:

  • (Symbol)

    :spray



32
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 32

display_mode :spray, 'O'

#starburstSymbol (readonly)

Display mode starburst (protocol display mode ‘P’)

Returns:

  • (Symbol)

    :starburst



33
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 33

display_mode :starburst, 'P'

#switchSymbol (readonly)

Display mode switch (protocol display mode ‘Q’)

Returns:

  • (Symbol)

    :switch



34
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 34

display_mode :switch, 'Q'

#twinkleSymbol (readonly)

Display mode twinkle (protocol display mode ‘R’)

Returns:

  • (Symbol)

    :twinkle



35
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 35

display_mode :twinkle, 'R'

#wipedownSymbol (readonly)

Display mode wipedown (protocol display mode ‘S’)

Returns:

  • (Symbol)

    :wipedown



36
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 36

display_mode :wipedown, 'S'

#wipeinSymbol (readonly)

Display mode wipein (protocol display mode ‘U’)

Returns:

  • (Symbol)

    :wipein



38
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 38

display_mode :wipein, 'U'

#wipeleftSymbol (readonly)

Display mode wipeleft (protocol display mode ‘W’)

Returns:

  • (Symbol)

    :wipeleft



40
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 40

display_mode :wipeleft, 'W'

#wipeoutSymbol (readonly)

Display mode wipeout (protocol display mode ‘V’)

Returns:

  • (Symbol)

    :wipeout



39
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 39

display_mode :wipeout, 'V'

#wiperightSymbol (readonly)

Display mode wiperight (protocol display mode ‘X’)

Returns:

  • (Symbol)

    :wiperight



41
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 41

display_mode :wiperight, 'X'

#wipeupSymbol (readonly)

Display mode wipeup (protocol display mode ‘T’)

Returns:

  • (Symbol)

    :wipeup



37
# File 'lib/movingsign_api/commands/internal/display_mode.rb', line 37

display_mode :wipeup, 'T'

Class Method Details

.parse(input) ⇒ Object



53
54
55
56
57
58
59
# 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