Class: PickyGuard::Statement
- Inherits:
-
Object
- Object
- PickyGuard::Statement
- Defined in:
- lib/picky_guard/statement.rb
Constant Summary collapse
- EFFECT_ALLOW =
:allow
- EFFECT_DENY =
:deny
- EFFECTS =
[EFFECT_ALLOW, EFFECT_DENY].freeze
- RESOURCE_TYPE_INSTANCE =
:instance
- RESOURCE_TYPE_CLASS =
:class
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#effect ⇒ Object
readonly
Returns the value of attribute effect.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #allow? ⇒ Boolean
- #deny? ⇒ Boolean
-
#initialize(effect, actions, resource, conditions) ⇒ Statement
constructor
A new instance of Statement.
Constructor Details
#initialize(effect, actions, resource, conditions) ⇒ Statement
Returns a new instance of Statement.
16 17 18 19 20 21 |
# File 'lib/picky_guard/statement.rb', line 16 def initialize(effect, actions, resource, conditions) @effect = effect @actions = actions @resource = resource @conditions = conditions end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
7 8 9 |
# File 'lib/picky_guard/statement.rb', line 7 def actions @actions end |
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
7 8 9 |
# File 'lib/picky_guard/statement.rb', line 7 def conditions @conditions end |
#effect ⇒ Object (readonly)
Returns the value of attribute effect.
7 8 9 |
# File 'lib/picky_guard/statement.rb', line 7 def effect @effect end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
7 8 9 |
# File 'lib/picky_guard/statement.rb', line 7 def resource @resource end |
Instance Method Details
#allow? ⇒ Boolean
23 24 25 |
# File 'lib/picky_guard/statement.rb', line 23 def allow? @effect == EFFECT_ALLOW end |
#deny? ⇒ Boolean
27 28 29 |
# File 'lib/picky_guard/statement.rb', line 27 def deny? @effect == EFFECT_DENY end |