class SSLScan::Socket::Range

A range of IP addresses

Attributes

options[RW]

@!attribute options

@return [Hash]
start[RW]

@!attribute start

The first address in this range, as a number
@return [Fixnum]
stop[RW]

@!attribute stop

The last address in this range, as a number
@return [Fixnum]

Public Class Methods

new(start=nil, stop=nil, options=nil) click to toggle source

@param start [Fixnum] @param stop [Fixnum] @param options [Hash] Recognized keys are:

* +:ipv6+
* +:scope_id+
# File lib/ssl_scan/socket/range_walker.rb, line 440
def initialize(start=nil, stop=nil, options=nil)
  @start = start
  @stop = stop
  @options = options
end

Public Instance Methods

==(other) click to toggle source

Compare attributes with other @param other [Range] @return [Boolean]

# File lib/ssl_scan/socket/range_walker.rb, line 449
def ==(other)
  (other.start == start && other.stop == stop && other.ipv6? == ipv6? && other.options == options)
end
count()
Alias for: length
ipv6?() click to toggle source

Whether this Range contains IPv6 or IPv4 addresses @return [Boolean]

# File lib/ssl_scan/socket/range_walker.rb, line 462
def ipv6?
  options[:ipv6]
end
length() click to toggle source

The number of addresses in this Range @return [Fixnum]

# File lib/ssl_scan/socket/range_walker.rb, line 455
def length
  stop - start + 1
end
Also aliased as: count