Class: Entrance::Agent::Acl::Base
- Inherits:
-
Object
- Object
- Entrance::Agent::Acl::Base
- Defined in:
- lib/entrance/agent/acl/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#as_digest ⇒ Object
Returns the value of attribute as_digest.
-
#comparator ⇒ Object
Returns the value of attribute comparator.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #acl ⇒ Object
- #condition ⇒ Object
-
#initialize(params = {}) ⇒ Base
constructor
A new instance of Base.
- #label ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 |
# File 'lib/entrance/agent/acl/base.rb', line 8 def initialize params={} @as_digest = params[:as_digest] @as_digest ||= true if @as_digest.nil? @comparator = params[:comparator] @value = params[:value] @name = params[:name] end |
Instance Attribute Details
#as_digest ⇒ Object
Returns the value of attribute as_digest.
7 8 9 |
# File 'lib/entrance/agent/acl/base.rb', line 7 def as_digest @as_digest end |
#comparator ⇒ Object
Returns the value of attribute comparator.
7 8 9 |
# File 'lib/entrance/agent/acl/base.rb', line 7 def comparator @comparator end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/entrance/agent/acl/base.rb', line 7 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/entrance/agent/acl/base.rb', line 7 def value @value end |
Instance Method Details
#acl ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/entrance/agent/acl/base.rb', line 15 def acl @acl = [] @acl << "acl" @acl << label @acl << comparator @acl << value @acl.join(" ") end |
#condition ⇒ Object
26 27 28 |
# File 'lib/entrance/agent/acl/base.rb', line 26 def condition "if #{label}" end |
#label ⇒ Object
23 24 25 |
# File 'lib/entrance/agent/acl/base.rb', line 23 def label as_digest ? Digest::MD5.hexdigest(name) : name end |