Class: Store::Mongodb::GTEFilter

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

Instance Method Summary collapse

Constructor Details

#initialize(field, value) ⇒ GTEFilter

Returns a new instance of GTEFilter.



271
272
273
# File 'lib/store/mongodb.rb', line 271

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

Instance Method Details

#add_filter(hash) ⇒ Object



275
276
277
278
279
280
281
# File 'lib/store/mongodb.rb', line 275

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

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