Class: RangeScan::Range

Inherits:
Object
  • Object
show all
Defined in:
lib/rangescan/range.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ip_with_subnet_mask) ⇒ Range

Returns a new instance of Range.



9
10
11
# File 'lib/rangescan/range.rb', line 9

def initialize(ip_with_subnet_mask)
  @ip_with_subnet_mask = IPAddress::IPv4.new(ip_with_subnet_mask)
end

Instance Attribute Details

#ip_with_subnet_maskObject (readonly)

Returns the value of attribute ip_with_subnet_mask.



7
8
9
# File 'lib/rangescan/range.rb', line 7

def ip_with_subnet_mask
  @ip_with_subnet_mask
end

Instance Method Details

#to_aObject



13
14
15
# File 'lib/rangescan/range.rb', line 13

def to_a
  ip_with_subnet_mask.to_a.map(&:to_s)
end