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
- #document ⇒ Boolean
- #documentation ⇒ String?
- #event ⇒ Boolean
- #eventheader ⇒ Boolean
- #eventheader_type ⇒ Boolean
- #eventpayload ⇒ Boolean
- #eventpayload_type ⇒ String
- #eventstream ⇒ Boolean
- #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.
- #location ⇒ String?
- #location=(location) ⇒ Object
- #location_name ⇒ String?
- #location_name=(location_name) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ShapeRef
Returns a new instance of ShapeRef.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/seahorse/model/shapes.rb', line 11 def initialize( = {}) @metadata = {} @required = false @deprecated = false @location = nil @location_name = nil @event = false @eventstream = false @eventpayload = false @eventpayload_type = ''.freeze @eventheader = false @eventheader_type = ''.freeze .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
44 45 46 |
# File 'lib/seahorse/model/shapes.rb', line 44 def deprecated @deprecated end |
#document ⇒ Boolean
65 66 67 |
# File 'lib/seahorse/model/shapes.rb', line 65 def document @document end |
#documentation ⇒ String?
41 42 43 |
# File 'lib/seahorse/model/shapes.rb', line 41 def documentation @documentation end |
#event ⇒ Boolean
47 48 49 |
# File 'lib/seahorse/model/shapes.rb', line 47 def event @event end |
#eventheader ⇒ Boolean
56 57 58 |
# File 'lib/seahorse/model/shapes.rb', line 56 def eventheader @eventheader end |
#eventheader_type ⇒ Boolean
62 63 64 |
# File 'lib/seahorse/model/shapes.rb', line 62 def eventheader_type @eventheader_type end |
#eventpayload ⇒ Boolean
53 54 55 |
# File 'lib/seahorse/model/shapes.rb', line 53 def eventpayload @eventpayload end |
#eventpayload_type ⇒ String
59 60 61 |
# File 'lib/seahorse/model/shapes.rb', line 59 def eventpayload_type @eventpayload_type end |
#eventstream ⇒ Boolean
50 51 52 |
# File 'lib/seahorse/model/shapes.rb', line 50 def eventstream @eventstream end |
#required ⇒ Boolean
38 39 40 |
# File 'lib/seahorse/model/shapes.rb', line 38 def required @required end |
Instance Method Details
#[](key) ⇒ Object
Gets metadata for the given ‘key`.
86 87 88 89 90 91 92 |
# File 'lib/seahorse/model/shapes.rb', line 86 def [](key) if @metadata.key?(key.to_s) @metadata[key.to_s] elsif @shape @shape[key.to_s] end end |
#[]=(key, value) ⇒ Object
Sets metadata for the given ‘key`.
95 96 97 |
# File 'lib/seahorse/model/shapes.rb', line 95 def []=(key, value) @metadata[key.to_s] = value end |
#location ⇒ String?
68 69 70 |
# File 'lib/seahorse/model/shapes.rb', line 68 def location @location || (shape && shape[:location]) end |
#location=(location) ⇒ Object
72 73 74 |
# File 'lib/seahorse/model/shapes.rb', line 72 def location= location @location = location end |
#location_name ⇒ String?
77 78 79 |
# File 'lib/seahorse/model/shapes.rb', line 77 def location_name @location_name || (shape && shape['locationName']) end |
#location_name=(location_name) ⇒ Object
81 82 83 |
# File 'lib/seahorse/model/shapes.rb', line 81 def location_name= location_name @location_name = location_name end |