Class: RubyMyq::Device::Base
- Inherits:
-
Object
- Object
- RubyMyq::Device::Base
- Defined in:
- lib/ruby_myq/device/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cached_hash ⇒ Object
readonly
Returns the value of attribute cached_hash.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#myq_id ⇒ Object
readonly
Returns the value of attribute myq_id.
-
#myq_name ⇒ Object
readonly
Returns the value of attribute myq_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent_system ⇒ Object
readonly
Returns the value of attribute parent_system.
Instance Method Summary collapse
-
#initialize(device) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(device) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ruby_myq/device/base.rb', line 6 def initialize(device) @cached_hash = device_hash @parent_system = parent_system @id = device_hash["DeviceId"] device_hash["Attributes"].each do |elem| @name = elem["Value"] if elem["Name"] == "desc" end @myq_id = device_hash["MyQDeviceId"] @myq_name = device_hash["DeviceName"] @device_type = device_hash["MyQDeviceTypeName"] end |
Instance Attribute Details
#cached_hash ⇒ Object (readonly)
Returns the value of attribute cached_hash.
4 5 6 |
# File 'lib/ruby_myq/device/base.rb', line 4 def cached_hash @cached_hash end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/ruby_myq/device/base.rb', line 4 def id @id end |
#myq_id ⇒ Object (readonly)
Returns the value of attribute myq_id.
4 5 6 |
# File 'lib/ruby_myq/device/base.rb', line 4 def myq_id @myq_id end |
#myq_name ⇒ Object (readonly)
Returns the value of attribute myq_name.
4 5 6 |
# File 'lib/ruby_myq/device/base.rb', line 4 def myq_name @myq_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/ruby_myq/device/base.rb', line 4 def name @name end |
#parent_system ⇒ Object (readonly)
Returns the value of attribute parent_system.
4 5 6 |
# File 'lib/ruby_myq/device/base.rb', line 4 def parent_system @parent_system end |