Class: MovingsignApi::DisplaySpeed
- Inherits:
-
Object
- Object
- MovingsignApi::DisplaySpeed
- Includes:
- PrettyKeyable
- Defined in:
- lib/movingsign_api/commands/internal/display_speed.rb
Overview
Text display mode speed sending
Display speed constants collapse
-
#faster ⇒ Symbol
readonly
Display speed
:faster
(protocol display speed ‘2’). -
#fastest ⇒ Symbol
readonly
Display speed
:fastest
(protocol display speed ‘1’). -
#normal ⇒ Symbol
readonly
Display speed
:normal
(protocol display speed ‘3’). -
#slow ⇒ Symbol
readonly
Display speed
:slow
(protocol display speed ‘4’). -
#slower ⇒ Symbol
readonly
Display speed
:slower
(protocol display speed ‘5’).
Instance Attribute Summary collapse
Class Method Summary collapse
-
.parse(input) ⇒ DisplaySpeed
Parses the supplied input into a DisplaySpeed instance if possible.
Instance Method Summary collapse
-
#initialize(speed) ⇒ DisplaySpeed
constructor
A new instance of DisplaySpeed.
Constructor Details
#initialize(speed) ⇒ DisplaySpeed
Returns a new instance of DisplaySpeed.
30 31 32 |
# File 'lib/movingsign_api/commands/internal/display_speed.rb', line 30 def initialize(speed) @key = speed end |
Instance Attribute Details
#faster ⇒ Symbol (readonly)
Display speed :faster
(protocol display speed ‘2’)
20 |
# File 'lib/movingsign_api/commands/internal/display_speed.rb', line 20 display_speed :faster, '2' |
#fastest ⇒ Symbol (readonly)
Display speed :fastest
(protocol display speed ‘1’)
19 |
# File 'lib/movingsign_api/commands/internal/display_speed.rb', line 19 display_speed :fastest, '1' |
#key ⇒ Symbol
28 29 30 |
# File 'lib/movingsign_api/commands/internal/display_speed.rb', line 28 def key @key end |
#normal ⇒ Symbol (readonly)
Display speed :normal
(protocol display speed ‘3’)
21 |
# File 'lib/movingsign_api/commands/internal/display_speed.rb', line 21 display_speed :normal, '3' |
#slow ⇒ Symbol (readonly)
Display speed :slow
(protocol display speed ‘4’)
22 |
# File 'lib/movingsign_api/commands/internal/display_speed.rb', line 22 display_speed :slow, '4' |
#slower ⇒ Symbol (readonly)
Display speed :slower
(protocol display speed ‘5’)
23 |
# File 'lib/movingsign_api/commands/internal/display_speed.rb', line 23 display_speed :slower, '5' |
Class Method Details
.parse(input) ⇒ DisplaySpeed
Parses the supplied input into a MovingsignApi::DisplaySpeed instance if possible
37 38 39 40 41 42 43 |
# File 'lib/movingsign_api/commands/internal/display_speed.rb', line 37 def self.parse(input) if key = parse_to_key(input) self.new key else raise InvalidInputError, "Display speed '#{input}' is invalid." end end |