Sha256: 7178ab5b10d36c3cbadf9ca5c078b91e1c3a624eda6cabb9794e493bbb827162
Contents?: true
Size: 1.26 KB
Versions: 4
Compression:
Stored size: 1.26 KB
Contents
module VagrantPlugins module CommandServe class Mappers class DurationProtoFromSpec < Mapper def initialize super( inputs: [Input.new(type: SDK::FuncSpec::Value) { |arg| arg.type == "hashicorp.vagrant.sdk.Args.TimeDuration" && !arg&.value&.value.nil? } ], output: SDK::Args::TimeDuration, func: method(:converter), ) end def converter(fv) SDK::Args::TimeDuration.decode(fv.value.value) end end class DurationFromProto < Mapper def initialize super( inputs: [Input.new(type: SDK::Args::TimeDuration)], output: Type::Duration, func: method(:converter), ) end def converter(proto) Type::Duration.new(value: proto.duration) end end class DurationToProto < Mapper def initialize super( inputs: [Input.new(type: Type::Duration)], output: SDK::Args::TimeDuration, func: method(:converter), ) end def converter(duration) SDK::Args::TimeDuration.new(duration: duration.value) end end end end end
Version data entries
4 entries across 4 versions & 2 rubygems