Sha256: 96a980da8be29a1ba81935aa36b29ff955981bccf35d7edc1216b8cb3d60e2a1

Contents?: true

Size: 358 Bytes

Versions: 4

Compression:

Stored size: 358 Bytes

Contents

module MightyGrid
  module Filters
    class CustomFilter < Base
      attr_reader :scope

      def initialize(options = {}, &block)
        self.class.default_options.merge!(scope: nil)

        super(options)

        if block_given?
          @scope = block
        else
          @scope = @options.delete(:scope)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mighty_grid-2.1.1 lib/mighty_grid/filters/custom_filter.rb
mighty_grid-2.1.0 lib/mighty_grid/filters/custom_filter.rb
mighty_grid-2.0.0 lib/mighty_grid/filters/custom_filter.rb
mighty_grid-2.0.0.rc1 lib/mighty_grid/filters/custom_filter.rb