Class: WeatherLink::Node

Inherits:
HashWrapper show all
Defined in:
lib/weatherlink/node.rb

Instance Attribute Summary collapse

Attributes inherited from HashWrapper

#data

Instance Method Summary collapse

Constructor Details

#initialize(client, data) ⇒ Node

Returns a new instance of Node.



7
8
9
10
# File 'lib/weatherlink/node.rb', line 7

def initialize(client, data)
  @client = client
  super(data)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class WeatherLink::HashWrapper

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/weatherlink/node.rb', line 5

def client
  @client
end

Instance Method Details

#descriptionObject



20
21
22
# File 'lib/weatherlink/node.rb', line 20

def description
  "#{station_name} - #{node_name}"
end

#inspectObject



16
17
18
# File 'lib/weatherlink/node.rb', line 16

def inspect
  to_s
end

#to_sObject



12
13
14
# File 'lib/weatherlink/node.rb', line 12

def to_s
  "#<#{self.class.name} device_id_hex=#{device_id_hex} (#{description})>"
end