Class: ResponseMate::Recorder
- Inherits:
-
Object
- Object
- ResponseMate::Recorder
- Defined in:
- lib/response_mate/recorder.rb
Overview
Handles recording requests
Instance Attribute Summary collapse
-
#conn ⇒ Object
Returns the value of attribute conn.
-
#keys ⇒ Object
Returns the value of attribute keys.
-
#manifest ⇒ Object
Returns the value of attribute manifest.
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Recorder
constructor
A new instance of Recorder.
- #record(keys) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Recorder
Returns a new instance of Recorder.
6 7 8 9 10 |
# File 'lib/response_mate/recorder.rb', line 6 def initialize(args = {}) @manifest = args[:manifest] @conn = ResponseMate::Connection.new @output_dir = args[:output_dir] end |
Instance Attribute Details
#conn ⇒ Object
Returns the value of attribute conn.
4 5 6 |
# File 'lib/response_mate/recorder.rb', line 4 def conn @conn end |
#keys ⇒ Object
Returns the value of attribute keys.
4 5 6 |
# File 'lib/response_mate/recorder.rb', line 4 def keys @keys end |
#manifest ⇒ Object
Returns the value of attribute manifest.
4 5 6 |
# File 'lib/response_mate/recorder.rb', line 4 def manifest @manifest end |
#output_dir ⇒ Object
Returns the value of attribute output_dir.
4 5 6 |
# File 'lib/response_mate/recorder.rb', line 4 def output_dir @output_dir end |
Instance Method Details
#record(keys) ⇒ Object
12 13 14 15 16 |
# File 'lib/response_mate/recorder.rb', line 12 def record(keys) requests = keys.empty? ? manifest.requests : manifest.requests_for_keys(keys) requests.each { |request| process request } end |