Class: Store::Mongodb::GTEFilter
- Inherits:
-
Object
- Object
- Store::Mongodb::GTEFilter
- Defined in:
- lib/store/mongodb.rb
Instance Method Summary collapse
- #add_filter(hash) ⇒ Object
-
#initialize(field, value) ⇒ GTEFilter
constructor
A new instance of GTEFilter.
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 |