Sha256: f062ed56ce30fcf4027fe62e8cca870f2b443108778bda78837155576c661dfb

Contents?: true

Size: 663 Bytes

Versions: 6

Compression:

Stored size: 663 Bytes

Contents

module RecordFilter
  class RestrictionFactory # :nodoc: all

    OPERATOR_HASH = {
      :equal_to => Restrictions::EqualTo,
      :is_null => Restrictions::IsNull,
      :less_than => Restrictions::LessThan,
      :less_than_or_equal_to => Restrictions::LessThanOrEqualTo,
      :greater_than => Restrictions::GreaterThan,
      :greater_than_or_equal_to => Restrictions::GreaterThanOrEqualTo,
      :in => Restrictions::In,
      :between => Restrictions::Between,
      :like => Restrictions::Like
    }

    def self.build(operator, column_name, value, table, options)
      OPERATOR_HASH[operator].new(column_name, value, table, options)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
record_filter-1.0.1 lib/record_filter/restriction_factory.rb
record_filter-1.0.0 lib/record_filter/restriction_factory.rb
record_filter-0.9.17 lib/record_filter/restriction_factory.rb
record_filter-0.9.16 lib/record_filter/restriction_factory.rb
record_filter-0.9.15 lib/record_filter/restriction_factory.rb
record_filter-0.9.14 lib/record_filter/restriction_factory.rb