Class: CanTango::PermissionEngine::Statements

Inherits:
Object
  • Object
show all
Defined in:
lib/cantango/permission_engine/statements.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, action, targets) ⇒ Statements

Returns a new instance of Statements.



6
7
8
9
10
# File 'lib/cantango/permission_engine/statements.rb', line 6

def initialize method, action, targets
  @method = method
  @action = action
  @targets = targets
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



4
5
6
# File 'lib/cantango/permission_engine/statements.rb', line 4

def action
  @action
end

#methodObject (readonly)

Returns the value of attribute method.



4
5
6
# File 'lib/cantango/permission_engine/statements.rb', line 4

def method
  @method
end

Instance Method Details

#to_codeObject



12
13
14
# File 'lib/cantango/permission_engine/statements.rb', line 12

def to_code
  parse_statements.join("\n")
end