Class: Humanoid::Criterion::Complex
- Defined in:
- lib/humanoid/criterion/complex.rb
Overview
Complex criterion are used when performing operations on symbols to get get a shorthand syntax for where clauses.
Example:
{ :field => { "$lt" => "value" } }
becomes: { :field.lt => "value }
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#operator ⇒ Object
Returns the value of attribute operator.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Complex
constructor
Create the new complex criterion.
Constructor Details
#initialize(opts = {}) ⇒ Complex
Create the new complex criterion.
16 17 18 |
# File 'lib/humanoid/criterion/complex.rb', line 16 def initialize(opts = {}) @key, @operator = opts[:key], opts[:operator] end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
13 14 15 |
# File 'lib/humanoid/criterion/complex.rb', line 13 def key @key end |
#operator ⇒ Object
Returns the value of attribute operator.
13 14 15 |
# File 'lib/humanoid/criterion/complex.rb', line 13 def operator @operator end |