Module: AFMotion::Operation::HTTP
- Defined in:
- lib/afmotion/operation.rb
Class Method Summary collapse
Class Method Details
.for_request(request, &callback) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/afmotion/operation.rb', line 4 def self.for_request(request, &callback) operation = AFHTTPRequestOperation.alloc.initWithRequest(request) operation.setCompletionBlockWithSuccess( lambda { |operation, responseObject| result = AFMotion::HTTPResult.new(operation, responseObject, nil) callback.call(result) }, failure: lambda {|operation, error| result = AFMotion::HTTPResult.new(operation, nil, error) callback.call(result) } ) operation end |