Class: CanTango::PermissionEngine::Parser::Regex

Inherits:
Rule
  • Object
show all
Defined in:
lib/cantango/permission_engine/parser/regex.rb

Instance Attribute Summary collapse

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

#regexObject (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

#parseObject



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