Class: ForemanProbing::Targeting::Subnet
- Inherits:
-
ForemanProbing::Targeting
- Object
- ActiveRecord::Base
- ForemanProbing::Targeting
- ForemanProbing::Targeting::Subnet
- Defined in:
- app/models/foreman_probing/targeting/subnet.rb
Instance Method Summary collapse
Instance Method Details
#subnet ⇒ Object
7 8 9 |
# File 'app/models/foreman_probing/targeting/subnet.rb', line 7 def subnet @subnet ||= ::Subnet..find(raw_targets.to_i) end |
#target_kind ⇒ Object
3 4 5 |
# File 'app/models/foreman_probing/targeting/subnet.rb', line 3 def target_kind 'subnet' end |
#targets ⇒ Object
11 12 13 14 15 |
# File 'app/models/foreman_probing/targeting/subnet.rb', line 11 def targets # TODO: This is ugly cidr = IPAddr.new(subnet.mask).to_i.to_s(2).count('1') @targets ||= "#{subnet.network}/#{cidr}" end |