Class: OpenApi::Encoding
- Inherits:
-
Object
- Object
- OpenApi::Encoding
- Includes:
- EquatableAsContent
- Defined in:
- lib/open_api/encoding.rb
Overview
Instance Attribute Summary collapse
-
#allow_reserved ⇒ Object
Returns the value of attribute allow_reserved.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#explode ⇒ Object
Returns the value of attribute explode.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#style ⇒ Object
Returns the value of attribute style.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(content_type: nil, headers: nil, style: nil, explode: nil, allow_reserved: false) ⇒ Encoding
constructor
A new instance of Encoding.
Methods included from EquatableAsContent
Constructor Details
#initialize(content_type: nil, headers: nil, style: nil, explode: nil, allow_reserved: false) ⇒ Encoding
Returns a new instance of Encoding.
8 9 10 11 12 13 14 |
# File 'lib/open_api/encoding.rb', line 8 def initialize(content_type: nil, headers: nil, style: nil, explode: nil, allow_reserved: false) self.content_type = content_type self.headers = headers self.style = style self.explode = explode self.allow_reserved = allow_reserved end |
Instance Attribute Details
#allow_reserved ⇒ Object
Returns the value of attribute allow_reserved.
6 7 8 |
# File 'lib/open_api/encoding.rb', line 6 def allow_reserved @allow_reserved end |
#content_type ⇒ Object
Returns the value of attribute content_type.
6 7 8 |
# File 'lib/open_api/encoding.rb', line 6 def content_type @content_type end |
#explode ⇒ Object
Returns the value of attribute explode.
6 7 8 |
# File 'lib/open_api/encoding.rb', line 6 def explode @explode end |
#headers ⇒ Object
Returns the value of attribute headers.
6 7 8 |
# File 'lib/open_api/encoding.rb', line 6 def headers @headers end |
#style ⇒ Object
Returns the value of attribute style.
6 7 8 |
# File 'lib/open_api/encoding.rb', line 6 def style @style end |
Class Method Details
.load(hash) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/open_api/encoding.rb', line 16 def self.load(hash) new( content_type: hash["contentType"]&.to_s, headers: hash["headers"]&.map { |k, v| [k, Reference.load(v) || Header.load(v)] }.to_h, style: hash["style"]&.to_s, explode: hash["explode"], allow_reserved: hash["allowReserved"].nil? ? false : hash["allowReserved"], ) end |