class Kokkai::Response
Public Class Methods
new(faraday_response)
click to toggle source
# File lib/kokkai/response.rb, line 5 def initialize(faraday_response) @raw_body = faraday_response.body @raw_headers = faraday_response.headers @raw_status = faraday_response.status end
Public Instance Methods
body()
click to toggle source
# File lib/kokkai/response.rb, line 11 def body Parser.new(@raw_body, @raw_status) end
headers()
click to toggle source
# File lib/kokkai/response.rb, line 15 def headers @headers ||= @raw_headers.inject({}) do |result, (key, value)| result.merge(key.split("-").map(&:capitalize).join("-") => value) end end
status()
click to toggle source
# File lib/kokkai/response.rb, line 21 def status @raw_status end