Class: MultiMovingsign::Sign
- Inherits:
-
Object
- Object
- MultiMovingsign::Sign
- Defined in:
- lib/multi_movingsign/sign.rb
Overview
Represents an individual Movingsign LED sign being driven
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ Sign
constructor
A new instance of Sign.
- #set_sound(on) ⇒ Object
- #show_text(text, options = {}) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(path) ⇒ Sign
Returns a new instance of Sign.
9 10 11 |
# File 'lib/multi_movingsign/sign.rb', line 9 def initialize(path) self.path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/multi_movingsign/sign.rb', line 7 def path @path end |
Class Method Details
.load(hash) ⇒ Object
13 14 15 16 17 |
# File 'lib/multi_movingsign/sign.rb', line 13 def self.load(hash) path = hash['path'] || (raise InvalidInputError, "path key not specified") self.new path end |
Instance Method Details
#set_sound(on) ⇒ Object
23 24 25 |
# File 'lib/multi_movingsign/sign.rb', line 23 def set_sound(on) sign.set_sound on end |
#show_text(text, options = {}) ⇒ Object
19 20 21 |
# File 'lib/multi_movingsign/sign.rb', line 19 def show_text(text, = {}) sign.show_text text, end |
#to_hash ⇒ Object
27 28 29 |
# File 'lib/multi_movingsign/sign.rb', line 27 def to_hash {'path' => self.path} end |