Class: Command
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(data = {}) ⇒ Command
constructor
A new instance of Command.
Methods inherited from HObject
Constructor Details
#initialize(data = {}) ⇒ Command
Returns a new instance of Command.
5 6 7 8 9 |
# File 'lib/lights/command.rb', line 5 def initialize(data = {}) @address = data["address"] @body = data["body"] @method = data["method"] end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
4 5 6 |
# File 'lib/lights/command.rb', line 4 def address @address end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/lights/command.rb', line 4 def body @body end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
4 5 6 |
# File 'lib/lights/command.rb', line 4 def method @method end |
Instance Method Details
#data ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/lights/command.rb', line 11 def data data = {} data["address"] = @address if @address data["body"] = @body if @body data["method"] = @method if @method data end |