Class: Ambient::DeviceInfo
- Inherits:
-
Object
- Object
- Ambient::DeviceInfo
- Defined in:
- lib/ambient/device.rb
Instance Attribute Summary collapse
-
#coords ⇒ Object
readonly
Returns the value of attribute coords.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, coords) ⇒ DeviceInfo
constructor
A new instance of DeviceInfo.
Constructor Details
#initialize(name, coords) ⇒ DeviceInfo
Returns a new instance of DeviceInfo.
11 12 13 14 |
# File 'lib/ambient/device.rb', line 11 def initialize(name, coords) @name = name @coords = coords end |
Instance Attribute Details
#coords ⇒ Object (readonly)
Returns the value of attribute coords.
5 6 7 |
# File 'lib/ambient/device.rb', line 5 def coords @coords end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/ambient/device.rb', line 5 def name @name end |
Class Method Details
.from_hash(data) ⇒ Object
7 8 9 |
# File 'lib/ambient/device.rb', line 7 def self.from_hash(data) DeviceInfo.new(data.dig("name"), data.dig("coords")) end |