Sha256: cc51769bff1ac74eb12dda4a6c724dd84ac5a84a142e24f932ec1b0173cc930d

Contents?: true

Size: 711 Bytes

Versions: 5

Compression:

Stored size: 711 Bytes

Contents

module Typus
  module Controller
    module Filters

      def self.included(base)
        base.helper_method :predefined_filters
      end

      protected

      def add_predefined_filter(*args)
        predefined_filters
        @predefined_filters << args unless args.empty?
      end

      def prepend_predefined_filter(*args)
        predefined_filters
        @predefined_filters = @predefined_filters.unshift(args) unless args.empty?
      end

      def append_predefined_filter(*args)
        predefined_filters
        @predefined_filters = @predefined_filters.concat([args]) unless args.empty?
      end

      def predefined_filters
        @predefined_filters ||= []
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
typus-3.1.0.rc11 lib/typus/controller/filters.rb
typus-3.1.0.rc10 lib/typus/controller/filters.rb
typus-3.1.0.rc9 lib/typus/controller/filters.rb
typus-3.1.0.rc8 lib/typus/controller/filters.rb
typus-3.1.0.rc7 lib/typus/controller/filters.rb