class ResponseMate::Inspector
Responsible for inspecting requests
Attributes
conn[RW]
manifest[RW]
Public Class Methods
new(args = {})
click to toggle source
# File lib/response_mate/inspector.rb, line 5 def initialize(args = {}) @manifest = args[:manifest] @conn = ResponseMate::Connection.new end
Public Instance Methods
inspect_key(key)
click to toggle source
Prints the output of the specified request @param [Symbol] The key to be inspected
# File lib/response_mate/inspector.rb, line 13 def inspect_key(key) request = manifest.requests.find { |r| r.key == key } puts request.to_cli_format print_pretty(conn.fetch(request)) end
Private Instance Methods
print_pretty(response)
click to toggle source
# File lib/response_mate/inspector.rb, line 22 def print_pretty(response) ap(status: response.status, headers: response.headers, body: response.body) end