Class Puppet::Network::AuthStore::Declaration
In: lib/puppet/network/authstore.rb
Parent: Object

A single declaration. Stores the info for a given declaration, provides the methods for determining whether a declaration matches, and handles sorting the declarations appropriately.

Methods

<=>   deny?   exact?   interpolate   ip?   match?   new   pattern=   result   to_s   type=  

Included Modules

Puppet::Util Comparable

Attributes

length  [RW]  The length. Only used for iprange and domain.
name  [RW]  The name: :ip or :domain
pattern  [R]  The pattern we‘re matching against. Can be an IPAddr instance, or an array of strings, resulting from reversing a hostname or domain name.
type  [R]  The type of declaration: either :allow or :deny

Public Class methods

Public Instance methods

Sort the declarations specially.

Are we an exact match?

interpolate a pattern to replace any backreferences by the given match for instance if our pattern is $1.reductivelabs.com and we‘re called with a MatchData whose capture 1 is puppet we‘ll return a pattern of puppet.reductivelabs.com

Are we an IP type?

Does this declaration match the name/ip combo?

Set the pattern appropriately. Also sets the name and length.

Mapping a type of statement into a return value.

Set the declaration type. Either :allow or :deny.

[Validate]