Class: Bridge
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#mac ⇒ Object
readonly
Returns the value of attribute mac.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(data = {}) ⇒ Bridge
constructor
A new instance of Bridge.
Methods inherited from HObject
Constructor Details
#initialize(data = {}) ⇒ Bridge
Returns a new instance of Bridge.
6 7 8 9 10 11 |
# File 'lib/lights/bridge.rb', line 6 def initialize(data = {}) @id = data["id"] @ip = data["internalipaddress"] @mac = data["macaddress"] @name = data["name"] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/lights/bridge.rb', line 5 def id @id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
5 6 7 |
# File 'lib/lights/bridge.rb', line 5 def ip @ip end |
#mac ⇒ Object (readonly)
Returns the value of attribute mac.
5 6 7 |
# File 'lib/lights/bridge.rb', line 5 def mac @mac end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/lights/bridge.rb', line 5 def name @name end |
Instance Method Details
#data ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/lights/bridge.rb', line 13 def data data = {} data["id"] = @id if @id data["internalipaddress"] = @ip if @ip data["macaddress"] = @mac if @mac data["name"] = @name if @name data end |