class Klient::ResponseData

Attributes

original_response[R]
parsed_body[R]
parsed_headers[R]
status_code[R]

Public Class Methods

new(status_code, parsed_body) click to toggle source
# File lib/klient/response_data.rb, line 13
def initialize(status_code, parsed_body)
  @status_code = status_code
  @parsed_body = parsed_body.freeze
end

Public Instance Methods

body() click to toggle source
# File lib/klient/response_data.rb, line 5
def body
  nil
end
headers() click to toggle source
# File lib/klient/response_data.rb, line 9
def headers
  nil
end
method_missing(mth, *args, &block) click to toggle source

TODO: Bandaid.

# File lib/klient/response_data.rb, line 23
def method_missing(mth, *args, &block)
  @parsed_body.send(mth, *args, &block)
end
ok?() click to toggle source
# File lib/klient/response_data.rb, line 18
def ok?
  (200..299).include?(status_code)
end
respond_to_missing?(mth, *args) click to toggle source
Calls superclass method
# File lib/klient/response_data.rb, line 27
def respond_to_missing?(mth, *args)
  mth.to_s =~ /http_(\d+)\?/ || @parsed_body.respond_to?(mth) || super
end