Module: CanTango::Api::Common

Included in:
Ability::Account, Ability::User, Model::Account, Model::User
Defined in:
lib/cantango/api/common.rb

Instance Method Summary collapse

Instance Method Details

#category(label) ⇒ Object


8
9
10
# File 'lib/cantango/api/common.rb', line 8

def category label
  config.models.by_category label
end

#create_ability(candidate, opts = {}) ⇒ Object


3
4
5
6
# File 'lib/cantango/api/common.rb', line 3

def create_ability candidate, opts = {}
  ability = default_ability_class.new candidate, opts
  config.ability.factory_build ability, opts.merge(:modes => execution_modes)
end