Class: Model::InstallationUsedDevice
- Inherits:
-
Object
- Object
- Model::InstallationUsedDevice
- Defined in:
- lib/models/installation_used_device.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #device ⇒ Object
-
#initialize(node, repository) ⇒ InstallationUsedDevice
constructor
A new instance of InstallationUsedDevice.
- #role ⇒ Object
Constructor Details
#initialize(node, repository) ⇒ InstallationUsedDevice
Returns a new instance of InstallationUsedDevice.
5 6 7 |
# File 'lib/models/installation_used_device.rb', line 5 def initialize(node, repository) @query = NodeQuery.new(node, repository) end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
3 4 5 |
# File 'lib/models/installation_used_device.rb', line 3 def query @query end |
Instance Method Details
#device ⇒ Object
9 10 11 12 |
# File 'lib/models/installation_used_device.rb', line 9 def device return nil unless query.value_exists?(LV.target) Device.new(query.value(LV.target), query.repository) end |
#role ⇒ Object
14 15 16 |
# File 'lib/models/installation_used_device.rb', line 14 def role query.value(LV.role) end |