Class: Store::Mongodb::GTFilter
- Inherits:
-
Object
- Object
- Store::Mongodb::GTFilter
- Defined in:
- lib/store/mongodb.rb
Instance Method Summary collapse
- #add_filter(hash) ⇒ Object
-
#initialize(field, value) ⇒ GTFilter
constructor
A new instance of GTFilter.
Constructor Details
#initialize(field, value) ⇒ GTFilter
Returns a new instance of GTFilter.
257 258 259 |
# File 'lib/store/mongodb.rb', line 257 def initialize(field, value) @field = field; @value = value end |
Instance Method Details
#add_filter(hash) ⇒ Object
261 262 263 264 265 266 267 |
# File 'lib/store/mongodb.rb', line 261 def add_filter(hash) h = hash[@field] ||= {} if @value != 'unknown' h['$gt'] = @value end end |