class Seahorse::Model::Shapes::StructureShape
Attributes
@return [Set<Symbol>]
@return [Class<Struct>]
Public Class Methods
Source
# File lib/seahorse/model/shapes.rb, line 217 def initialize(options = {}) @members = {} @members_by_location_name = {} @required = Set.new super end
Calls superclass method
Seahorse::Model::Shapes::Shape::new
Public Instance Methods
Source
# File lib/seahorse/model/shapes.rb, line 232 def add_member(name, shape_ref) name = name.to_sym @required << name if shape_ref.required @members_by_location_name[shape_ref.location_name] = [name, shape_ref] @members[name] = shape_ref end
@param [Symbol] name @param [ShapeRef] shape_ref
Source
# File lib/seahorse/model/shapes.rb, line 258 def member(name) if member?(name) @members[name.to_sym] else raise ArgumentError, "no such member #{name.inspect}" end end
@param [Symbol] name @return [ShapeRef]
Source
# File lib/seahorse/model/shapes.rb, line 247 def member?(member_name) @members.key?(member_name.to_sym) end
@param [Symbol] member_name @return [Boolean] Returns ‘true` if there exists a member with
the given name.
Source
# File lib/seahorse/model/shapes.rb, line 267 def member_by_location_name(location_name) @members_by_location_name[location_name] end
@api private
Source
# File lib/seahorse/model/shapes.rb, line 240 def member_names @members.keys end
@return [Array<Symbol>]
Source
# File lib/seahorse/model/shapes.rb, line 252 def members @members.to_enum end
@return [Enumerator<>]