class Seahorse::Model::ShapeMap
@api private
def build_shape(shape_ref)
def build_shape(shape_ref) Shapes::Shape.new(resolve(shape_ref), shape_map: self) end
def initialize(shape_defs = {})
-
shape_defs
(Hash
) -- ({}) A hash of shape definitions.
def initialize(shape_defs = {}) @definitions = shape_defs @shapes = {} end
def resolve(shape_ref)
def resolve(shape_ref) if definition = @definitions[shape_ref['shape']] definition.merge(shape_ref) else raise ArgumentError, "shape not found for #{shape_ref.inspect}" end end
def shape(shape_ref)
-
(ArgumentError)
- Raised when the given shape ref can not be
Returns:
-
(Shapes::Shape)
-
Options Hash:
(**shape_ref)
-
'shape'
(required, String
) --
Parameters:
-
shape_ref
(Hash
) --
def shape(shape_ref) @shapes[shape_ref] ||= build_shape(shape_ref) end
def shape_names
-
(Array
-)
def shape_names @definitions.keys end