Class: Model::InstallationUsedDevice

Inherits:
Object
  • Object
show all
Defined in:
lib/models/installation_used_device.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#queryObject (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

#deviceObject



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

#roleObject



14
15
16
# File 'lib/models/installation_used_device.rb', line 14

def role
  query.value(LV.role)
end