Class: LEDENET::Device
- Inherits:
-
Object
- Object
- LEDENET::Device
- Defined in:
- lib/ledenet/device_discovery.rb
Instance Attribute Summary collapse
-
#hw_addr ⇒ Object
readonly
Returns the value of attribute hw_addr.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(device_str) ⇒ Device
constructor
A new instance of Device.
Constructor Details
#initialize(device_str) ⇒ Device
Returns a new instance of Device.
9 10 11 12 13 14 15 |
# File 'lib/ledenet/device_discovery.rb', line 9 def initialize(device_str) parts = device_str.split(',') @ip = parts[0] @hw_addr = parts[1] @model = parts[2] end |
Instance Attribute Details
#hw_addr ⇒ Object (readonly)
Returns the value of attribute hw_addr.
7 8 9 |
# File 'lib/ledenet/device_discovery.rb', line 7 def hw_addr @hw_addr end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
7 8 9 |
# File 'lib/ledenet/device_discovery.rb', line 7 def ip @ip end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/ledenet/device_discovery.rb', line 7 def model @model end |