Class: CanTango::PermissionEngine::Parser::Ownership
- Defined in:
- lib/cantango/permission_engine/parser/ownership.rb
Instance Attribute Summary collapse
-
#model_class ⇒ Object
readonly
Returns the value of attribute model_class.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
Attributes inherited from Rule
#action, #method, #model, #target
Instance Method Summary collapse
Methods inherited from Rule
#initialize, #parse_class, #try_class
Constructor Details
This class inherits a constructor from CanTango::PermissionEngine::Parser::Rule
Instance Attribute Details
#model_class ⇒ Object (readonly)
Returns the value of attribute model_class.
5 6 7 |
# File 'lib/cantango/permission_engine/parser/ownership.rb', line 5 def model_class @model_class end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
5 6 7 |
# File 'lib/cantango/permission_engine/parser/ownership.rb', line 5 def owner @owner end |
Instance Method Details
#parse ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/cantango/permission_engine/parser/ownership.rb', line 7 def parse match = target[/(\w+)#(\w+)/] @target = match[$1] @owner = match[$2] @model_class = try_class build_ownership_dsl end |