Class: ForemanDatacenter::DeviceType

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/foreman_datacenter/device_type.rb

Constant Summary collapse

SUBDEVICE_ROLES =
['None', 'Parent', 'Child'].freeze

Instance Method Summary collapse

Instance Method Details

#child?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/models/foreman_datacenter/device_type.rb', line 31

def child?
  subdevice_role == 'Child'
end

#management_interfacesObject



39
40
41
# File 'app/models/foreman_datacenter/device_type.rb', line 39

def management_interfaces
  interface_templates.select(&:mgmt_only)
end

#network_interfacesObject



35
36
37
# File 'app/models/foreman_datacenter/device_type.rb', line 35

def network_interfaces
  interface_templates.reject(&:mgmt_only)
end

#parent?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/models/foreman_datacenter/device_type.rb', line 27

def parent?
  subdevice_role == 'Parent'
end