Class: Seahorse::Model::Shapes::ShapeRef
- Inherits:
-
Object
- Object
- Seahorse::Model::Shapes::ShapeRef
- Defined in:
- lib/seahorse/model/shapes.rb
Instance Attribute Summary collapse
- #deprecated ⇒ Boolean
- #documentation ⇒ String?
- #location ⇒ String?
- #location_name ⇒ String?
- #required ⇒ Boolean
- #shape ⇒ Shape
Instance Method Summary collapse
-
#[](key) ⇒ Object
Gets metadata for the given ‘key`.
-
#[]=(key, value) ⇒ Object
Sets metadata for the given ‘key`.
-
#initialize(options = {}) ⇒ ShapeRef
constructor
A new instance of ShapeRef.
Constructor Details
#initialize(options = {}) ⇒ ShapeRef
Returns a new instance of ShapeRef.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/seahorse/model/shapes.rb', line 9 def initialize( = {}) @metadata = {} @required = false @deprecated = false .each do |key, value| if key == :metadata value.each do |k,v| self[k] = v end else send("#{key}=", value) end end end |
Instance Attribute Details
#deprecated ⇒ Boolean
40 41 42 |
# File 'lib/seahorse/model/shapes.rb', line 40 def deprecated @deprecated end |
#documentation ⇒ String?
37 38 39 |
# File 'lib/seahorse/model/shapes.rb', line 37 def documentation @documentation end |
#location ⇒ String?
28 29 30 |
# File 'lib/seahorse/model/shapes.rb', line 28 def location @location end |
#location_name ⇒ String?
31 32 33 |
# File 'lib/seahorse/model/shapes.rb', line 31 def location_name @location_name end |
#required ⇒ Boolean
34 35 36 |
# File 'lib/seahorse/model/shapes.rb', line 34 def required @required end |
Instance Method Details
#[](key) ⇒ Object
Gets metadata for the given ‘key`.
43 44 45 46 47 48 49 |
# File 'lib/seahorse/model/shapes.rb', line 43 def [](key) if @metadata.key?(key.to_s) @metadata[key.to_s] else @shape[key.to_s] end end |
#[]=(key, value) ⇒ Object
Sets metadata for the given ‘key`.
52 53 54 |
# File 'lib/seahorse/model/shapes.rb', line 52 def []=(key, value) @metadata[key.to_s] = value end |