Module: Seahorse::Model::Shapes
- Included in:
- Aws::Api::OperationExample
- Defined in:
- lib/seahorse/model/shapes.rb
Defined Under Namespace
Classes: Blob, Boolean, Byte, Character, Double, Float, Integer, List, Long, Map, Shape, String, Structure, Timestamp
Class Method Summary collapse
-
.register(type, shape_class) ⇒ void
Registers a shape by type.
-
.shape_class(type) ⇒ Class<Shape>
Given a type, this method returned the registered shape class.
-
.types ⇒ Enumerator
Returns an enumerator that yields registered type names and shape classes.
Class Method Details
.register(type, shape_class) ⇒ void
23 24 25 26 |
# File 'lib/seahorse/model/shapes.rb', line 23 def register(type, shape_class) shape_class.type = type @types[type] = shape_class end |
.shape_class(type) ⇒ Class<Shape>
Given a type, this method returned the registered shape class.
33 34 35 36 37 38 39 |
# File 'lib/seahorse/model/shapes.rb', line 33 def shape_class(type) if @types.key?(type) @types[type] else raise ArgumentError, "unregisterd type `#{type}'" end end |
.types ⇒ Enumerator
50 51 52 53 54 55 56 |
# File 'lib/seahorse/model/shapes.rb', line 50 def types Enumerator.new do |y| @types.each do |name, shape_class| y.yield(name, shape_class) end end end |