Class: Facebooker::Service::TyphoeusMultiService

Inherits:
TyphoeusService show all
Defined in:
lib/facebooker/service/typhoeus_multi_service.rb

Instance Method Summary collapse

Methods inherited from TyphoeusService

#post_form, #post_multipart_form

Methods inherited from BaseService

#post_params

Constructor Details

#initializeTyphoeusMultiService

Returns a new instance of TyphoeusMultiService.



3
4
5
# File 'lib/facebooker/service/typhoeus_multi_service.rb', line 3

def initialize
  @result_objects = []
end

Instance Method Details

#add_result(obj) ⇒ Object



18
19
20
# File 'lib/facebooker/service/typhoeus_multi_service.rb', line 18

def add_result(obj)
  @result_objects << obj
end

#parse_results?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/facebooker/service/typhoeus_multi_service.rb', line 7

def parse_results?
  false
end

#perform_post(url, params) ⇒ Object



14
15
16
# File 'lib/facebooker/service/typhoeus_multi_service.rb', line 14

def perform_post(url,params)
  add_result(self.class.async_post(:base_uri=>url,:params=>params))
end

#processObject



22
23
24
25
26
# File 'lib/facebooker/service/typhoeus_multi_service.rb', line 22

def process
  # we need to access all objects to make sure the proxy has made the request
  @result_objects.each(&:nil?)
  @result_objects = []
end