Class: Plumb::Metadata
- Inherits:
-
Object
- Object
- Plumb::Metadata
- Includes:
- Composable
- Defined in:
- lib/plumb/metadata.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #call(result) ⇒ Object
-
#initialize(type, metadata) ⇒ Metadata
constructor
A new instance of Metadata.
- #metadata(data = Undefined) ⇒ Object
Methods included from Composable
#>>, #[], #as_node, #build, #check, #children, #defer, #generate, included, #invalid, #invoke, #match, #not, #pipeline, #policy, #static, #to_json_schema, #to_s, #transform, #value, #where, #with, wrap, #|
Methods included from Callable
Constructor Details
#initialize(type, metadata) ⇒ Metadata
Returns a new instance of Metadata.
9 10 11 12 13 |
# File 'lib/plumb/metadata.rb', line 9 def initialize(type, ) @type = type @metadata = type..merge() freeze end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/plumb/metadata.rb', line 7 def type @type end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/plumb/metadata.rb', line 15 def ==(other) other.is_a?(self.class) && @metadata == other. end |
#call(result) ⇒ Object
27 |
# File 'lib/plumb/metadata.rb', line 27 def call(result) = type.call(result) |