Class: Facebooker::BatchRun
Overview
Constant Summary
Constants inherited
from Parser
Parser::PARSERS
Class Method Summary
collapse
Methods inherited from Parser
anonymous_field_from, array_of, array_of_hashes, array_of_text_values, element, hash_or_value_for, hashinate, parse
Class Method Details
.current_batch ⇒ Object
206
207
208
|
# File 'lib/facebooker/parser.rb', line 206
def current_batch
Thread.current[:facebooker_current_batch]
end
|
.current_batch=(current_batch) ⇒ Object
203
204
205
|
# File 'lib/facebooker/parser.rb', line 203
def current_batch=(current_batch)
Thread.current[:facebooker_current_batch]=current_batch
end
|
.process(data) ⇒ Object
210
211
212
213
214
215
216
217
218
219
220
221
|
# File 'lib/facebooker/parser.rb', line 210
def self.process(data)
array_of_text_values(element('batch_run_response',data),"batch_run_response_elt").each_with_index do |response,i|
batch_request=current_batch[i]
body=Struct.new(:body).new
body.body=CGI.unescapeHTML(response)
begin
batch_request.result=Parser.parse(batch_request.method,body)
rescue Exception=>ex
batch_request.exception_raised=ex
end
end
end
|