Class: CanTango::PermissionEngine::Parser::Regex
- Defined in:
- lib/cantango/permission_engine/parser/regex.rb
Instance Attribute Summary collapse
-
#regex ⇒ Object
readonly
Returns the value of attribute regex.
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
#regex ⇒ Object (readonly)
Returns the value of attribute regex.
5 6 7 |
# File 'lib/cantango/permission_engine/parser/regex.rb', line 5 def regex @regex end |
Instance Method Details
#parse ⇒ Object
7 8 9 10 11 |
# File 'lib/cantango/permission_engine/parser/regex.rb', line 7 def parse target.gsub!(/\/(.*)\//, '\1') @regex = /#{target}/ build_statement end |