Sha256: 454b45ee28fa5cbe8e86b8556455a0a8a566e29f08c83616b9eefd5e0e56fb4c

Contents?: true

Size: 716 Bytes

Versions: 12

Compression:

Stored size: 716 Bytes

Contents

module CanTango
  module Rails
    module Helpers
      module BaseHelper
        def self.included(base)
          include_apis(base)
          # base.send :include, CanTango::Rails::Helpers::RestHelper
          base.extend ClassMethods
        end

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

          def apis
            [:Can, :Scope]
          end
        end
        extend ClassMethods
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cantango-0.9.4.3 lib/cantango/rails/helpers/base_helper.rb
cantango-0.9.4.2 lib/cantango/rails/helpers/base_helper.rb
cantango-0.9.4.1 lib/cantango/rails/helpers/base_helper.rb
cantango-0.9.4 lib/cantango/rails/helpers/base_helper.rb
cantango-0.8.9 lib/cantango/rails/helpers/base_helper.rb
cantango-0.8.8.1 lib/cantango/rails/helpers/base_helper.rb
cantango-0.8.8 lib/cantango/rails/helpers/base_helper.rb
cantango-0.8.7 lib/cantango/rails/helpers/base_helper.rb
cantango-0.8.6.2 lib/cantango/rails/helpers/base_helper.rb
cantango-0.8.6.1 lib/cantango/rails/helpers/base_helper.rb
cantango-0.8.6 lib/cantango/rails/helpers/base_helper.rb
cantango-0.8.5.1 lib/cantango/rails/helpers/base_helper.rb