Class: LEDENET::Device

Inherits:
Object
  • Object
show all
Defined in:
lib/ledenet/device_discovery.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_addrObject (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

#ipObject (readonly)

Returns the value of attribute ip.



7
8
9
# File 'lib/ledenet/device_discovery.rb', line 7

def ip
  @ip
end

#modelObject (readonly)

Returns the value of attribute model.



7
8
9
# File 'lib/ledenet/device_discovery.rb', line 7

def model
  @model
end