Class: JunosConfig::Security::AddressSet
- Inherits:
-
Object
- Object
- JunosConfig::Security::AddressSet
- Defined in:
- lib/junos-config/security/addressset.rb
Instance Attribute Summary collapse
-
#addresses ⇒ Object
Returns the value of attribute addresses.
-
#config ⇒ Object
Returns the value of attribute config.
-
#name ⇒ Object
Returns the value of attribute name.
-
#raw ⇒ Object
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(config, raw) ⇒ AddressSet
constructor
A new instance of AddressSet.
- #lookup_addresses(addressbook) ⇒ Object
Constructor Details
#initialize(config, raw) ⇒ AddressSet
Returns a new instance of AddressSet.
9 10 11 12 13 14 15 16 |
# File 'lib/junos-config/security/addressset.rb', line 9 def initialize(config, raw) @config = config @raw = raw @name = raw.match(/^\ {16}address-set (\S+)\ \{$/)[1] @addresses = raw.scan(/^(\ {20}address (\S+);)$/).collect do |x| String.new x[1] end end |
Instance Attribute Details
#addresses ⇒ Object
Returns the value of attribute addresses.
4 5 6 |
# File 'lib/junos-config/security/addressset.rb', line 4 def addresses @addresses end |
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/junos-config/security/addressset.rb', line 4 def config @config end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/junos-config/security/addressset.rb', line 4 def name @name end |
#raw ⇒ Object
Returns the value of attribute raw.
4 5 6 |
# File 'lib/junos-config/security/addressset.rb', line 4 def raw @raw end |
Instance Method Details
#lookup_addresses(addressbook) ⇒ Object
18 19 20 21 22 |
# File 'lib/junos-config/security/addressset.rb', line 18 def lookup_addresses( addressbook ) @addresses.collect! do |addr| addressbook.resolve(addr) end end |