Class: Rooq::Condition
- Inherits:
-
Object
- Object
- Rooq::Condition
- Extended by:
- T::Sig
- Defined in:
- lib/rooq/condition.rb
Instance Attribute Summary collapse
- #expression ⇒ Expression readonly
- #operator ⇒ Symbol readonly
- #value ⇒ T.untyped readonly
Instance Method Summary collapse
- #and(other) ⇒ CombinedCondition
-
#field ⇒ Expression
Backwards compatibility.
- #initialize(expression, operator, value) ⇒ void constructor
- #or(other) ⇒ CombinedCondition
Constructor Details
#initialize(expression, operator, value) ⇒ void
23 24 25 26 27 28 |
# File 'lib/rooq/condition.rb', line 23 def initialize(expression, operator, value) @expression = expression @operator = operator @value = value freeze end |
Instance Attribute Details
#expression ⇒ Expression (readonly)
14 15 16 |
# File 'lib/rooq/condition.rb', line 14 def expression @expression end |
#operator ⇒ Symbol (readonly)
17 18 19 |
# File 'lib/rooq/condition.rb', line 17 def operator @operator end |
#value ⇒ T.untyped (readonly)
20 21 22 |
# File 'lib/rooq/condition.rb', line 20 def value @value end |
Instance Method Details
#and(other) ⇒ CombinedCondition
37 38 39 |
# File 'lib/rooq/condition.rb', line 37 def and(other) CombinedCondition.new(:and, [self, other]) end |
#field ⇒ Expression
Backwards compatibility
32 33 34 |
# File 'lib/rooq/condition.rb', line 32 def field @expression end |
#or(other) ⇒ CombinedCondition
42 43 44 |
# File 'lib/rooq/condition.rb', line 42 def or(other) CombinedCondition.new(:or, [self, other]) end |