Class: Fog::Bouncer::Sources::CIDR
- Inherits:
-
Fog::Bouncer::Source
- Object
- Fog::Bouncer::Source
- Fog::Bouncer::Sources::CIDR
- Defined in:
- lib/fog/bouncer/sources.rb
Instance Attribute Summary collapse
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
Attributes inherited from Fog::Bouncer::Source
#group, #local, #remote, #source
Instance Method Summary collapse
-
#initialize(source, group, &block) ⇒ CIDR
constructor
A new instance of CIDR.
- #match(source) ⇒ Object
- #range ⇒ Object
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
#ip ⇒ Object (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 |
#range ⇒ Object
32 33 34 |
# File 'lib/fog/bouncer/sources.rb', line 32 def range @source end |