Class: ResponseMate::Inspector
- Inherits:
-
Object
- Object
- ResponseMate::Inspector
- Defined in:
- lib/response_mate/inspector.rb
Overview
Responsible for inspecting requests
Instance Attribute Summary collapse
-
#conn ⇒ Object
Returns the value of attribute conn.
-
#manifest ⇒ Object
Returns the value of attribute manifest.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Inspector
constructor
A new instance of Inspector.
-
#inspect_key(key) ⇒ Object
Prints the output of the specified request.
Constructor Details
#initialize(args = {}) ⇒ Inspector
Returns a new instance of Inspector.
5 6 7 8 9 |
# File 'lib/response_mate/inspector.rb', line 5 def initialize(args = {}) @manifest = args[:manifest] @conn = ResponseMate::Connection.new end |
Instance Attribute Details
#conn ⇒ Object
Returns the value of attribute conn.
3 4 5 |
# File 'lib/response_mate/inspector.rb', line 3 def conn @conn end |
#manifest ⇒ Object
Returns the value of attribute manifest.
3 4 5 |
# File 'lib/response_mate/inspector.rb', line 3 def manifest @manifest end |
Instance Method Details
#inspect_key(key) ⇒ Object
Prints the output of the specified request
13 14 15 16 17 18 |
# 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 |