Class: Store::Mongodb::LTFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/store/mongodb.rb

Instance Method Summary collapse

Constructor Details

#initialize(field, value) ⇒ LTFilter

Returns a new instance of LTFilter.



243
244
245
# File 'lib/store/mongodb.rb', line 243

def initialize(field, value)
  @field = field; @value = value
end

Instance Method Details

#add_filter(hash) ⇒ Object



247
248
249
250
251
252
253
# File 'lib/store/mongodb.rb', line 247

def add_filter(hash)
  h = hash[@field] ||= {}

  if @value != 'unknown'
    h['$lt'] = @value
  end
end