Class: Device
- Inherits:
-
Object
- Object
- Device
- Defined in:
- lib/models/device.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(node, repository) ⇒ Device
constructor
A new instance of Device.
- #location ⇒ Object
- #manufacturer_name ⇒ Object
- #node ⇒ Object
Constructor Details
#initialize(node, repository) ⇒ Device
Returns a new instance of Device.
4 5 6 |
# File 'lib/models/device.rb', line 4 def initialize(node, repository) @query = NodeQuery.new(node, repository) end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
2 3 4 |
# File 'lib/models/device.rb', line 2 def query @query end |
Instance Method Details
#description ⇒ Object
12 13 14 |
# File 'lib/models/device.rb', line 12 def description query.value(LV.description) end |
#location ⇒ Object
16 17 18 19 20 21 |
# File 'lib/models/device.rb', line 16 def location node = query.value(LV.locatedAt) return nil if node.nil? Location.new(node, query.repository) end |
#manufacturer_name ⇒ Object
8 9 10 |
# File 'lib/models/device.rb', line 8 def manufacturer_name query.value(LV.manufacturerName) end |
#node ⇒ Object
23 24 25 |
# File 'lib/models/device.rb', line 23 def node query.node end |