lib/ringcentral_sdk/rest/client.rb 1 location
|
@@ 181-185 (lines=5) @@
|
| 178 |
|
return api_key |
| 179 |
|
end |
| 180 |
|
|
| 181 |
|
def send_request(request_sdk = {}) |
| 182 |
|
if request_sdk.is_a? Hash |
| 183 |
|
request_sdk = RingCentralSdk::REST::Request::Simple.new(request_sdk) |
| 184 |
|
elsif !request_sdk.is_a? RingCentralSdk::REST::Request::Base |
| 185 |
|
fail 'Request is not a RingCentralSdk::REST::Request::Base' |
| 186 |
|
end |
| 187 |
|
|
| 188 |
|
method = request_sdk.method.to_s.downcase |
lib/ringcentral_sdk/rest/simple_client.rb 1 location
|
@@ 25-29 (lines=5) @@
|
| 22 |
|
@client = client |
| 23 |
|
end |
| 24 |
|
|
| 25 |
|
def send(request) |
| 26 |
|
if request.is_a?(RingCentralSdk::Helpers::Request) |
| 27 |
|
return @client.request(request) |
| 28 |
|
elsif ! request.is_a?(Hash) |
| 29 |
|
raise "Request is not a RingCentralSdk::Helpers::Request or Hash" |
| 30 |
|
end |
| 31 |
|
|
| 32 |
|
verb = request.key?(:verb) ? request[:verb].to_s.downcase : 'get' |