Class: Dry::Logic::Rule::Composite
- Inherits:
-
Dry::Logic::Rule
- Object
- Dry::Logic::Rule
- Dry::Logic::Rule::Composite
- Defined in:
- lib/dry/logic/rule/composite.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Attributes inherited from Dry::Logic::Rule
Instance Method Summary collapse
-
#initialize(left, right) ⇒ Composite
constructor
A new instance of Composite.
- #to_ary ⇒ Object (also: #to_a)
Methods inherited from Dry::Logic::Rule
#and, #call, #curry, #negation, #new, #or, #predicate_id, #then, #type, #xor
Constructor Details
#initialize(left, right) ⇒ Composite
8 9 10 11 |
# File 'lib/dry/logic/rule/composite.rb', line 8 def initialize(left, right) @left = left @right = right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
6 7 8 |
# File 'lib/dry/logic/rule/composite.rb', line 6 def left @left end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/dry/logic/rule/composite.rb', line 6 def name @name end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
6 7 8 |
# File 'lib/dry/logic/rule/composite.rb', line 6 def right @right end |
Instance Method Details
#to_ary ⇒ Object Also known as: to_a
17 18 19 |
# File 'lib/dry/logic/rule/composite.rb', line 17 def to_ary [type, [left.to_ary, right.to_ary]] end |