class RingCentralSdk::REST::Request::Simple

Simple is a generic simple request class.

Attributes

body[R]
headers[R]
method[R]
params[R]
url[R]

Public Class Methods

new(opts = {}) click to toggle source
# File lib/ringcentral_sdk/rest/request/simple.rb, line 12
def initialize(opts = {})
  @method = opts[:method]
  @url = opts[:url]
  @params = opts[:params]
  @headers = opts[:headers]
  @body = opts[:body].nil? ? {} : opts[:body]
  if @body.is_a? Hash
    @headers = {} unless @headers.is_a? Hash
    @headers['Content-Type'] = 'application/json'
  end
end

Public Instance Methods

content_type() click to toggle source
# File lib/ringcentral_sdk/rest/request/simple.rb, line 24
def content_type
  @headers.is_a?(Hash) ? @headers['Content-Type'] || '' : 'application/json'
end