Class: Rooq::CombinedCondition
- Inherits:
-
Object
- Object
- Rooq::CombinedCondition
- Extended by:
- T::Sig
- Defined in:
- lib/rooq/condition.rb
Instance Attribute Summary collapse
- #conditions ⇒ Array<AnyCondition> readonly
- #operator ⇒ Symbol readonly
Instance Method Summary collapse
- #and(other) ⇒ CombinedCondition
- #initialize(operator, conditions) ⇒ void constructor
- #or(other) ⇒ CombinedCondition
Constructor Details
#initialize(operator, conditions) ⇒ void
57 58 59 60 61 |
# File 'lib/rooq/condition.rb', line 57 def initialize(operator, conditions) @operator = operator @conditions = T.let(conditions.freeze, T::Array[AnyCondition]) freeze end |
Instance Attribute Details
#conditions ⇒ Array<AnyCondition> (readonly)
54 55 56 |
# File 'lib/rooq/condition.rb', line 54 def conditions @conditions end |
#operator ⇒ Symbol (readonly)
51 52 53 |
# File 'lib/rooq/condition.rb', line 51 def operator @operator end |
Instance Method Details
#and(other) ⇒ CombinedCondition
64 65 66 |
# File 'lib/rooq/condition.rb', line 64 def and(other) CombinedCondition.new(:and, [*@conditions, other]) end |
#or(other) ⇒ CombinedCondition
69 70 71 |
# File 'lib/rooq/condition.rb', line 69 def or(other) CombinedCondition.new(:or, [*@conditions, other]) end |