Module: ForemanNetbox::Nic::BaseExtensions
- Defined in:
- app/models/concerns/foreman_netbox/nic/base_extensions.rb
Instance Method Summary collapse
Instance Method Details
#netbox_ip ⇒ Object
14 15 16 |
# File 'app/models/concerns/foreman_netbox/nic/base_extensions.rb', line 14 def netbox_ip ip && subnet && "#{ip}/#{subnet.cidr}" end |
#netbox_ip6 ⇒ Object
18 19 20 |
# File 'app/models/concerns/foreman_netbox/nic/base_extensions.rb', line 18 def netbox_ip6 ip6 && subnet6 && "#{ip6}/#{subnet6.cidr}" end |
#netbox_ips ⇒ Object
10 11 12 |
# File 'app/models/concerns/foreman_netbox/nic/base_extensions.rb', line 10 def netbox_ips [netbox_ip, netbox_ip6].compact end |
#netbox_name ⇒ Object
6 7 8 |
# File 'app/models/concerns/foreman_netbox/nic/base_extensions.rb', line 6 def netbox_name identifier || (mac && "Interface #{mac}") end |