Class: Fog::Bouncer::Sources::CIDR

Inherits:
Fog::Bouncer::Source show all
Defined in:
lib/fog/bouncer/sources.rb

Instance Attribute Summary collapse

Attributes inherited from Fog::Bouncer::Source

#group, #local, #remote, #source

Instance Method Summary collapse

Methods inherited from Fog::Bouncer::Source

#==, #add_protocol, #extras, #inspect, #local?, #missing, #protocols, #remote?

Constructor Details

#initialize(source, group, &block) ⇒ CIDR

Returns a new instance of CIDR.



22
23
24
25
26
# File 'lib/fog/bouncer/sources.rb', line 22

def initialize(source, group, &block)
  @ip = IPAddress::IPv4.new(source)
  source = @ip.to_string
  super
end

Instance Attribute Details

#ipObject (readonly)

Returns the value of attribute ip.



20
21
22
# File 'lib/fog/bouncer/sources.rb', line 20

def ip
  @ip
end

Instance Method Details

#match(source) ⇒ Object



28
29
30
# File 'lib/fog/bouncer/sources.rb', line 28

def match(source)
  range == source
end

#rangeObject



32
33
34
# File 'lib/fog/bouncer/sources.rb', line 32

def range
  @source
end