class RSpecApib::Response

Attributes

raw_response[RW]

Public Class Methods

new(response) click to toggle source
# File lib/rspec_apib/response.rb, line 5
def initialize(response)
  self.raw_response = response
end

Public Instance Methods

body() click to toggle source

The response body @return [String] The response body - always as a string

# File lib/rspec_apib/response.rb, line 15
def body
  JSON.generate raw_response.body
end
content_type() click to toggle source
# File lib/rspec_apib/response.rb, line 23
def content_type
  headers["Content-Type"]
end
headers() click to toggle source
# File lib/rspec_apib/response.rb, line 27
def headers
  raw_response.response_headers
end
status() click to toggle source
# File lib/rspec_apib/response.rb, line 9
def status
  raw_response.status.to_s
end
validate_body_with_json_schema?() click to toggle source
# File lib/rspec_apib/response.rb, line 19
def validate_body_with_json_schema?
  json?
end

Private Instance Methods

json?() click to toggle source
# File lib/rspec_apib/response.rb, line 35
def json?
  content_type =~ /json/
end