Module: ForemanNetbox::Nic::BaseExtensions

Defined in:
app/models/concerns/foreman_netbox/nic/base_extensions.rb

Instance Method Summary collapse

Instance Method Details

#netbox_ipObject



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_ip6Object



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_ipsObject



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_nameObject



6
7
8
# File 'app/models/concerns/foreman_netbox/nic/base_extensions.rb', line 6

def netbox_name
  identifier || (mac && "Interface #{mac}")
end