Sha256: 6b2406a10ba7a6d07944beb4bc7f1213e0b30ab57005e4835a4c50946e945ded

Contents?: true

Size: 787 Bytes

Versions: 15

Compression:

Stored size: 787 Bytes

Contents

module PushType
  module ApplicationControllerMethods
    extend ActiveSupport::Concern

    FILTERS = [
      :before_node_load_filters, :before_node_action_filters, :after_node_action_filters
    ]

    included do
      class_attribute *FILTERS
    end

    protected

    def permalink_path
      params[:permalink].split('/')
    end

    private

    FILTERS.each do |filter|
      define_method(filter) { self.class.send(filter) }
    end

    module ClassMethods
      FILTERS.each do |filter|
        method_name = filter.to_s.gsub(/_filters$/, '')

        define_method method_name do |*args, &block|
          args.push block if block
          filters = ( self.send(filter) || [] ) << args
          self.send "#{ filter }=", filters
        end
      end
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
push_type_core-0.10.0.beta.3 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.9.5 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.9.3 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.9.2 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.9.1 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.9.0 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.9.0.beta.4 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.9.0.beta.3 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.9.0.beta.2 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.8.2 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.8.1 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.8.0 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.8.0.beta.3 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.8.0.beta.2 app/controllers/concerns/push_type/application_controller_methods.rb
push_type_core-0.8.0.beta.1 app/controllers/concerns/push_type/application_controller_methods.rb