Class: Plumb::Composable::Node
- Inherits:
-
Object
- Object
- Plumb::Composable::Node
- Includes:
- Plumb::Composable
- Defined in:
- lib/plumb/composable.rb
Overview
Support #as_node.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#node_name ⇒ Object
readonly
Returns the value of attribute node_name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #call(result) ⇒ Object
-
#initialize(node_name, type, attributes = BLANK_HASH) ⇒ Node
constructor
A new instance of Node.
Methods included from Plumb::Composable
#>>, #[], #as_node, #build, #check, #children, #defer, #generate, included, #invalid, #invoke, #match, #metadata, #not, #pipeline, #policy, #static, #to_json_schema, #to_s, #transform, #value, wrap, #|
Methods included from Plumb::Callable
Constructor Details
#initialize(node_name, type, attributes = BLANK_HASH) ⇒ Node
Returns a new instance of Node.
278 279 280 281 282 283 |
# File 'lib/plumb/composable.rb', line 278 def initialize(node_name, type, attributes = BLANK_HASH) @node_name = node_name @type = type @attributes = attributes freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
276 277 278 |
# File 'lib/plumb/composable.rb', line 276 def attributes @attributes end |
#node_name ⇒ Object (readonly)
Returns the value of attribute node_name.
276 277 278 |
# File 'lib/plumb/composable.rb', line 276 def node_name @node_name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
276 277 278 |
# File 'lib/plumb/composable.rb', line 276 def type @type end |
Instance Method Details
#call(result) ⇒ Object
285 |
# File 'lib/plumb/composable.rb', line 285 def call(result) = type.call(result) |