class Swaggable::RackResponseAdapter
Attributes
rack_response[RW]
Public Class Methods
new(rack_response = default_rack_response)
click to toggle source
# File lib/swaggable/rack_response_adapter.rb, line 3 def initialize rack_response = default_rack_response @rack_response = rack_response end
Public Instance Methods
==(other)
click to toggle source
# 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
Also aliased as: eql?
code()
click to toggle source
# File lib/swaggable/rack_response_adapter.rb, line 15 def code rack_response[0] end
code=(value)
click to toggle source
# File lib/swaggable/rack_response_adapter.rb, line 19 def code= value rack_response[0] = value end
content_type()
click to toggle source
# File lib/swaggable/rack_response_adapter.rb, line 7 def content_type rack_headers['Content-Type'] end
content_type=(value)
click to toggle source
# File lib/swaggable/rack_response_adapter.rb, line 11 def content_type= value rack_headers['Content-Type'] = value end
hash()
click to toggle source
# File lib/swaggable/rack_response_adapter.rb, line 33 def hash rack_response.hash end
Protected Instance Methods
default_rack_response()
click to toggle source
# File lib/swaggable/rack_response_adapter.rb, line 41 def default_rack_response [200, {}, []] end
rack_headers()
click to toggle source
# File lib/swaggable/rack_response_adapter.rb, line 45 def rack_headers rack_response[1] end