Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 55d2313042
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (30 sloc) 0.886 kb
class RequestGod
attr_accessor :base_URL, :regular_requests, :resource_requests
# singleton
def self.instance(*args)
if args.count == 1
@@instance ||= new args[0]
else
@@instance ||= new
end
end
def initialize(base_URL)
@regular_requests = []
@resource_requests = []
@base_URL = base_URL
RKClient.clientWithBaseURLString base_URL
self
end
def base_URL=(base_URL)
@base_URL = base_URL
RKClient.clientWithBaseURLString base_URL
end
def RegularRequest(path, method:method, delegate:delegate)
@regular_requests << RegularRequest.new(@regular_requests.count, path, method, delegate)
@regular_requests.last
end
def ResourceRequest(path, method:method, delegate:delegate)
@resource_requests << ResourceRequest.new(@resource_requests.count, path, method, delegate)
@resource_requests.last
end
end
Jump to Line
Something went wrong with that request. Please try again.