Module: CanTango::PermissionEngine::Parser

Defined in:
lib/cantango/permission_engine/parser.rb,
lib/cantango/permission_engine/parser/rule.rb,
lib/cantango/permission_engine/parser/regex.rb,
lib/cantango/permission_engine/parser/default.rb,
lib/cantango/permission_engine/parser/category.rb,
lib/cantango/permission_engine/parser/ownership.rb,
lib/cantango/permission_engine/parser/categories.rb,
lib/cantango/permission_engine/parser/permissions.rb,
lib/cantango/permission_engine/parser/relationship.rb

Defined Under Namespace

Classes: Categories, Category, Default, Ownership, Permissions, Regex, Relationship, Rule

Class Method Summary collapse

Class Method Details

.create_for(method, action, target) ⇒ Object



7
8
9
10
11
12
# File 'lib/cantango/permission_engine/parser.rb', line 7

def self.create_for method, action, target
  type = parser_type target
  parser_name = "CanTango::PermissionEngine::Parser::#{type.to_s.camelize}"
  parser_class = parser_name.constantize
  parser_class.new method, action, target
end