Sha256: e472e5831ea2867b30b31e194a7bfeacd01bfa26eae5270db10dd3ce6c6f3149

Contents?: true

Size: 567 Bytes

Versions: 10

Compression:

Stored size: 567 Bytes

Contents

module CanTango
  module Filter
    class Base
      attr_reader :item, :include_list

      def initialize item, list = nil
        @item         = item.to_sym
        @include_list = list.map(&:to_sym) || []
      end

      def valid?
        return false if !in_include_list?
        return false if not_only?
        !excluded?
      end

      def in_include_list?
        return false if include_list.blank?
        include_list.include? item
      end

      def not_only?
        false
      end

      def excluded?
        false
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cantango-core-0.1.9.3 lib/cantango/filter/base.rb
cantango-core-0.1.9.2 lib/cantango/filter/base.rb
cantango-core-0.1.9.1 lib/cantango/filter/base.rb
cantango-core-0.1.9 lib/cantango/filter/base.rb
cantango-core-0.1.8 lib/cantango/filter/base.rb
cantango-core-0.1.7 lib/cantango/filter/base.rb
cantango-core-0.1.6 lib/cantango/filter/base.rb
cantango-core-0.1.5 lib/cantango/filter/base.rb
cantango-core-0.1.4 lib/cantango/filter/base.rb
cantango-core-0.1.3 lib/cantango/filter/base.rb