Class: Plumb::Composable::Node

Inherits:
Object
  • Object
show all
Includes:
Plumb::Composable
Defined in:
lib/plumb/composable.rb

Overview

 Support #as_node.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#parse, #resolve

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

#attributesObject (readonly)

Returns the value of attribute attributes.



276
277
278
# File 'lib/plumb/composable.rb', line 276

def attributes
  @attributes
end

#node_nameObject (readonly)

Returns the value of attribute node_name.



276
277
278
# File 'lib/plumb/composable.rb', line 276

def node_name
  @node_name
end

#typeObject (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)