Class: Authorization::Engine::AttributeValidator
- Inherits:
-
Object
- Object
- Authorization::Engine::AttributeValidator
- Defined in:
- lib/declarative_authorization/authorization.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#privilege ⇒ Object
readonly
Returns the value of attribute privilege.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #evaluate(value_block) ⇒ Object
-
#initialize(engine, user, object = nil, privilege = nil, context = nil) ⇒ AttributeValidator
constructor
A new instance of AttributeValidator.
Constructor Details
#initialize(engine, user, object = nil, privilege = nil, context = nil) ⇒ AttributeValidator
Returns a new instance of AttributeValidator.
274 275 276 277 278 279 280 |
# File 'lib/declarative_authorization/authorization.rb', line 274 def initialize (engine, user, object = nil, privilege = nil, context = nil) @engine = engine @user = user @object = object @privilege = privilege @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
273 274 275 |
# File 'lib/declarative_authorization/authorization.rb', line 273 def context @context end |
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
273 274 275 |
# File 'lib/declarative_authorization/authorization.rb', line 273 def engine @engine end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
273 274 275 |
# File 'lib/declarative_authorization/authorization.rb', line 273 def object @object end |
#privilege ⇒ Object (readonly)
Returns the value of attribute privilege.
273 274 275 |
# File 'lib/declarative_authorization/authorization.rb', line 273 def privilege @privilege end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
273 274 275 |
# File 'lib/declarative_authorization/authorization.rb', line 273 def user @user end |
Instance Method Details
#evaluate(value_block) ⇒ Object
282 283 284 285 |
# File 'lib/declarative_authorization/authorization.rb', line 282 def evaluate (value_block) # TODO cache? instance_eval(&value_block) end |