Class: Swaggable::RackResponseAdapter
- Inherits:
-
Object
- Object
- Swaggable::RackResponseAdapter
- Defined in:
- lib/swaggable/rack_response_adapter.rb
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #code ⇒ Object
- #code=(value) ⇒ Object
- #content_type ⇒ Object
- #content_type=(value) ⇒ Object
- #hash ⇒ Object
-
#initialize(rack_response = default_rack_response) ⇒ RackResponseAdapter
constructor
A new instance of RackResponseAdapter.
Constructor Details
#initialize(rack_response = default_rack_response) ⇒ RackResponseAdapter
Returns a new instance of RackResponseAdapter.
3 4 5 |
# File 'lib/swaggable/rack_response_adapter.rb', line 3 def initialize rack_response = default_rack_response @rack_response = rack_response end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
23 24 25 26 27 28 29 |
# File 'lib/swaggable/rack_response_adapter.rb', line 23 def == other if other.respond_to? :rack_response, true rack_response == other.rack_response else false end end |
#code ⇒ Object
15 16 17 |
# File 'lib/swaggable/rack_response_adapter.rb', line 15 def code rack_response[0] end |
#code=(value) ⇒ Object
19 20 21 |
# File 'lib/swaggable/rack_response_adapter.rb', line 19 def code= value rack_response[0] = value end |
#content_type ⇒ Object
7 8 9 |
# File 'lib/swaggable/rack_response_adapter.rb', line 7 def content_type rack_headers['Content-Type'] end |
#content_type=(value) ⇒ Object
11 12 13 |
# File 'lib/swaggable/rack_response_adapter.rb', line 11 def content_type= value rack_headers['Content-Type'] = value end |
#hash ⇒ Object
33 34 35 |
# File 'lib/swaggable/rack_response_adapter.rb', line 33 def hash rack_response.hash end |