class BitGirder::Http::HttpResponse
Attributes
body[R]
headers[R]
status[R]
Public Class Methods
from_mingle_struct( ms )
click to toggle source
# File lib/bitgirder/http.rb, line 242 def self.from_mingle_struct( ms ) stat, hdrs, body = ms[ :status ], ms[ :headers ], ms[ :body ] self.new( :status => stat ? HttpStatus.from_mingle_struct( stat ) : nil, :headers => hdrs ? HttpHeaders.from_mingle_struct( hdrs ) : nil, :body => body ? body.buf : nil ) end
from_net_http_response( resp, opts = {} )
click to toggle source
# File lib/bitgirder/http.rb, line 207 def self.from_net_http_response( resp, opts = {} ) not_nil( resp, :resp ) not_nil( opts, :opts ) log_body = opts[ :log_body ] attrs = { :status => HttpStatus.as_instance( resp ), :headers => HttpHeaders.as_instance( resp ) } if opts[ :log_body ] && resp.class.body_permitted? attrs[ :body ] = resp.body end new( attrs ) end
new( opts = {} )
click to toggle source
Default constructor which takes a hash containing the following attributes:
- :
body
- :
headers
- :
status
- :
# File lib/doc-gen20.rb, line 173 def initialize( opts = {} ) # Autogenerated stub for docs end
Public Instance Methods
to_mingle_struct()
click to toggle source
# File lib/bitgirder/http.rb, line 230 def to_mingle_struct MingleStruct.new( :type => :"bitgirder:http@v1/HttpResponse", :fields => { :status => @status ? @status.to_mingle_struct : nil, :headers => @headers ? @headers.to_mingle_struct : nil, :body => @body ? MingleBuffer.new( body ) : nil } ) end