Module: CanTango::Ability::Rules

Included in:
Base, Executor
Defined in:
lib/cantango/ability/rules.rb

Instance Method Summary collapse

Instance Method Details

#calculate_rulesObject



3
4
5
# File 'lib/cantango/ability/rules.rb', line 3

def calculate_rules
  rules
end

#clear_rules!Object



16
17
18
# File 'lib/cantango/ability/rules.rb', line 16

def clear_rules!
  rules = default_rules
end

#default_rulesObject



20
21
22
# File 'lib/cantango/ability/rules.rb', line 20

def default_rules
  []
end

#normalize_rules!Object



7
8
9
10
# File 'lib/cantango/ability/rules.rb', line 7

def normalize_rules!
  rules.flatten!
  rules.compact!
end

#rulesObject



12
13
14
# File 'lib/cantango/ability/rules.rb', line 12

def rules
  @rules ||= []
end