Module: CanTango::Ability::Rules
Instance Method Summary collapse
- #calculate_rules ⇒ Object
- #clear_rules! ⇒ Object
- #default_rules ⇒ Object
- #normalize_rules! ⇒ Object
- #rules ⇒ Object
Instance Method Details
#calculate_rules ⇒ Object
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_rules ⇒ Object
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 |
#rules ⇒ Object
12 13 14 |
# File 'lib/cantango/ability/rules.rb', line 12 def rules @rules ||= [] end |