Class: Reyes::IPSetBuilder
- Inherits:
-
Object
- Object
- Reyes::IPSetBuilder
- Includes:
- Chalk::Log
- Defined in:
- lib/reyes/ipset.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- TYPE =
"hash:ip"
Instance Attribute Summary collapse
-
#members ⇒ Object
readonly
Returns the value of attribute members.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#<<(entity) ⇒ Object
Add a new member to this set.
-
#build ⇒ Object
Builds the ipset, retuning an IPSet.
-
#initialize(name) ⇒ IPSetBuilder
constructor
Constructor for ipsets, maintaining the invariant that once constructed, ipsets will not be altered.
Constructor Details
#initialize(name) ⇒ IPSetBuilder
Constructor for ipsets, maintaining the invariant that once constructed, ipsets will not be altered.
12 13 14 15 |
# File 'lib/reyes/ipset.rb', line 12 def initialize(name) @name = name @members = [] end |
Instance Attribute Details
#members ⇒ Object (readonly)
Returns the value of attribute members.
4 5 6 |
# File 'lib/reyes/ipset.rb', line 4 def members @members end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/reyes/ipset.rb', line 4 def name @name end |
Instance Method Details
#<<(entity) ⇒ Object
Add a new member to this set. ‘member` should be something an ipset can understand, eg an ip address or cidr range
20 21 22 |
# File 'lib/reyes/ipset.rb', line 20 def <<(entity) @members << entity end |