Module: CanTango::Rails::Helpers::BaseHelper::ClassMethods

Included in:
CanTango::Rails::Helpers::BaseHelper
Defined in:
lib/cantango/rails/helpers/base_helper.rb

Instance Method Summary collapse

Instance Method Details

#apisObject



21
22
23
# File 'lib/cantango/rails/helpers/base_helper.rb', line 21

def apis
  [:Can, :Scope, :Ability, :Session]
end

#include_apis(clazz) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/cantango/rails/helpers/base_helper.rb', line 12

def include_apis(clazz)
  return if !respond_to?(:apis) || !apis
  apis.each do |api|
    # puts "include API: #{api}"
    clazz.send :include, "CanTango::Api::User::#{api}".constantize
    clazz.send :include, "CanTango::Api::UserAccount::#{api}".constantize
  end
end