pzol/omnis — pull request #2 by pithyless (2013-01-15 13:51:51+00:00)
Title: Each supported Operator is responsible for serializing to Mongo

This case statement makes it impossible to add new Operators for Mongo without forking the gem:

```ruby
def mongo_operator(operator)
case operator
when Equals; operator.value
when Matches; /#{operator.value}/i
when BeginsWith; /^#{operator.value}/i
when Between; { :'$gte' => operator.value.begin, :'$lt' => operator.value.end}
end
end
```

Pull request makes each Operator responsible for serializing value to Mongo via `#mongo_value`.

Did not implement `NullOperator#mongo_value`. Instead of raising `NoMethodError`, other valid possibilities could be raising `NotImplementedError` or returning `nil`.