class Plumb::Build
def _inspect = "Build[#{@type.inspect}]"
def _inspect = "Build[#{@type.inspect}]"
def call(result) = result.valid(@block.call(result.value))
def call(result) = result.valid(@block.call(result.value))
def initialize(type, factory_method: :new, &block)
def initialize(type, factory_method: :new, &block) @type = type @block = block || ->(value) { type.send(factory_method, value) } @children = [type].freeze freeze end