Class: TypePadTemplate::Request
- Inherits:
-
Object
- Object
- TypePadTemplate::Request
- Defined in:
- lib/type_pad_template/request.rb
Constant Summary collapse
- DEFAULT_HOST_NAME =
"www.typepad.com"
- MAX_CONCURRENCY =
10
Class Method Summary collapse
Instance Method Summary collapse
- #dispatch ⇒ Object
- #enqueue(&block) ⇒ Object
-
#initialize(url_or_path, options = {}) ⇒ Request
constructor
A new instance of Request.
- #response ⇒ Object
Constructor Details
#initialize(url_or_path, options = {}) ⇒ Request
Returns a new instance of Request.
14 15 16 17 |
# File 'lib/type_pad_template/request.rb', line 14 def initialize(url_or_path, = {}) @url_or_path = url_or_path @options = end |
Class Method Details
.dispatch ⇒ Object
6 7 8 |
# File 'lib/type_pad_template/request.rb', line 6 def self.dispatch hydra.run end |
.hydra ⇒ Object
10 11 12 |
# File 'lib/type_pad_template/request.rb', line 10 def self.hydra @@hydra ||= Typhoeus::Hydra.new(:max_concurrency => MAX_CONCURRENCY) end |
Instance Method Details
#dispatch ⇒ Object
27 28 29 30 31 32 |
# File 'lib/type_pad_template/request.rb', line 27 def dispatch hydra = Typhoeus::Hydra.new hydra.queue(request) hydra.run self end |