Remove target from String mapper

This commit is contained in:
Chris Roberts 2021-11-17 14:55:58 -08:00 committed by Paul Hinze
parent d95147bd6f
commit c3fb475abe
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -34,18 +34,17 @@ module VagrantPlugins
end
end
# Build a target client from a serialized proto string
class TargetFromString < Mapper
class TargetToProto < Mapper
def initialize
inputs = [].tap do |i|
i << Input.new(type: String)
i << Input.new(type: Broker)
end
super(inputs: inputs, output: Client::Target, func: method(:converter))
super(
inputs: [Input.new(type: Client::Target)],
output: SDK::Args::Target,
func: method(:converter),
)
end
def converter(proto, broker)
Client::Target.load(proto, broker: broker)
def converter(t)
t.to_proto
end
end
end