Class: Hatchet::OrCondition
- Inherits:
-
Object
- Object
- Hatchet::OrCondition
- Defined in:
- lib/hatchet/conditions.rb
Overview
Represents an OR group of conditions. The task proceeds when ANY condition is met.
Instance Attribute Summary collapse
-
#conditions ⇒ Array
readonly
The conditions in this OR group.
Instance Method Summary collapse
-
#initialize(*conditions) ⇒ OrCondition
constructor
A new instance of OrCondition.
- #to_h ⇒ Hash
Constructor Details
#initialize(*conditions) ⇒ OrCondition
Returns a new instance of OrCondition.
93 94 95 |
# File 'lib/hatchet/conditions.rb', line 93 def initialize(*conditions) @conditions = conditions end |
Instance Attribute Details
#conditions ⇒ Array (readonly)
Returns The conditions in this OR group.
90 91 92 |
# File 'lib/hatchet/conditions.rb', line 90 def conditions @conditions end |
Instance Method Details
#to_h ⇒ Hash
98 99 100 |
# File 'lib/hatchet/conditions.rb', line 98 def to_h { type: "or", conditions: @conditions.map(&:to_h) } end |