Class: Plumb::And
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Instance Method Summary collapse
- #call(result) ⇒ Object
-
#initialize(left, right) ⇒ And
constructor
A new instance of And.
Methods included from Composable
#>>, #[], #as_node, #build, #check, #defer, #generate, included, #invalid, #invoke, #match, #metadata, #not, #pipeline, #policy, #static, #to_json_schema, #to_s, #transform, #value, wrap, #|
Methods included from Callable
Constructor Details
#initialize(left, right) ⇒ And
Returns a new instance of And.
11 12 13 14 15 16 |
# File 'lib/plumb/and.rb', line 11 def initialize(left, right) @left = left @right = right @children = [left, right].freeze freeze end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
9 10 11 |
# File 'lib/plumb/and.rb', line 9 def children @children end |
Instance Method Details
#call(result) ⇒ Object
22 23 24 |
# File 'lib/plumb/and.rb', line 22 def call(result) result.map(@left).map(@right) end |