Class: RequestRepeater::RequestMaker
- Inherits:
-
Object
- Object
- RequestRepeater::RequestMaker
- Defined in:
- lib/request_repeater/request_maker.rb
Constant Summary collapse
- InvalidURL =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#endpoints ⇒ Object
readonly
Returns the value of attribute endpoints.
-
#sleeper ⇒ Object
writeonly
Sets the attribute sleeper.
Instance Method Summary collapse
-
#initialize(endpoints) ⇒ RequestMaker
constructor
A new instance of RequestMaker.
- #run ⇒ Object
Constructor Details
#initialize(endpoints) ⇒ RequestMaker
Returns a new instance of RequestMaker.
8 9 10 |
# File 'lib/request_repeater/request_maker.rb', line 8 def initialize(endpoints) @endpoints = endpoints end |
Instance Attribute Details
#endpoints ⇒ Object (readonly)
Returns the value of attribute endpoints.
5 6 7 |
# File 'lib/request_repeater/request_maker.rb', line 5 def endpoints @endpoints end |
#sleeper=(value) ⇒ Object
Sets the attribute sleeper
6 7 8 |
# File 'lib/request_repeater/request_maker.rb', line 6 def sleeper=(value) @sleeper = value end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/request_repeater/request_maker.rb', line 12 def run loop do endpoints.each do |e| e.execute do request(e.uri) end end sleeper.call(minimum_sleep) end end |