Class: Aws::ParamConverter Private
- Inherits:
-
Object
- Object
- Aws::ParamConverter
- Includes:
- Seahorse::Model::Shapes
- Defined in:
- lib/aws-sdk-core/param_converter.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
-
.add(shape_class, value_class, converter = nil, &block) ⇒ void
private
Registers a new value converter.
- .c(shape, value) ⇒ Object private
- .convert(shape, params) ⇒ Object private
Instance Method Summary collapse
- #convert(params) ⇒ Hash private
-
#initialize(rules) ⇒ ParamConverter
constructor
private
A new instance of ParamConverter.
Constructor Details
#initialize(rules) ⇒ ParamConverter
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ParamConverter.
16 17 18 |
# File 'lib/aws-sdk-core/param_converter.rb', line 16 def initialize(rules) @rules = rules end |
Class Method Details
.add(shape_class, value_class, converter = nil, &block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Registers a new value converter. Converters run in the context of a shape and value class.
# add a converter that stringifies integers
shape_class = Seahorse::Model::Shapes::StringShape
ParamConverter.add(shape_class, Integer) { |i| i.to_s }
96 97 98 |
# File 'lib/aws-sdk-core/param_converter.rb', line 96 def add(shape_class, value_class, converter = nil, &block) @converters[shape_class][value_class] = converter || block end |
.c(shape, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
101 102 103 104 105 106 107 |
# File 'lib/aws-sdk-core/param_converter.rb', line 101 def c(shape, value) if converter = converter_for(shape, value) converter.call(value) else value end end |
.convert(shape, params) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
77 78 79 |
# File 'lib/aws-sdk-core/param_converter.rb', line 77 def convert(shape, params) new(shape).convert(params) end |
Instance Method Details
#convert(params) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/aws-sdk-core/param_converter.rb', line 22 def convert(params) structure(@rules, params) end |