Class: Dry::Logic::Operations::Abstract
- Inherits:
-
Object
- Object
- Dry::Logic::Operations::Abstract
- Includes:
- Core::Constants, Dry::Logic::Operators
- Defined in:
- lib/dry/logic/operations/abstract.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
- #curry(*args) ⇒ Object
- #id ⇒ Object
-
#initialize(*rules, **options) ⇒ Abstract
constructor
A new instance of Abstract.
- #new(rules, **new_options) ⇒ Object
- #to_ast ⇒ Object
- #with(new_options) ⇒ Object
Methods included from Dry::Logic::Operators
Constructor Details
#initialize(*rules, **options) ⇒ Abstract
Returns a new instance of Abstract.
15 16 17 18 |
# File 'lib/dry/logic/operations/abstract.rb', line 15 def initialize(*rules, **) @rules = rules @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/dry/logic/operations/abstract.rb', line 13 def @options end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
11 12 13 |
# File 'lib/dry/logic/operations/abstract.rb', line 11 def rules @rules end |
Instance Method Details
#curry(*args) ⇒ Object
24 25 26 |
# File 'lib/dry/logic/operations/abstract.rb', line 24 def curry(*args) new(rules.map { |rule| rule.curry(*args) }, **) end |
#id ⇒ Object
20 21 22 |
# File 'lib/dry/logic/operations/abstract.rb', line 20 def id [:id] end |
#new(rules, **new_options) ⇒ Object
28 29 30 |
# File 'lib/dry/logic/operations/abstract.rb', line 28 def new(rules, **) self.class.new(*rules, **, **) end |
#to_ast ⇒ Object
36 37 38 |
# File 'lib/dry/logic/operations/abstract.rb', line 36 def to_ast ast end |
#with(new_options) ⇒ Object
32 33 34 |
# File 'lib/dry/logic/operations/abstract.rb', line 32 def with() new(rules, **, **) end |