Sha256: 9972ad610322a44732c65d24cd927956e57268e5a49c7b8e23faca044a141986

Contents?: true

Size: 791 Bytes

Versions: 10

Compression:

Stored size: 791 Bytes

Contents

module RingCentralSdk::REST::Request
  class Simple < RingCentralSdk::REST::Request::Base
    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

      def content_type
        ct = @headers.is_a?(Hash) \
          ? @headers['Content-Type'] || '' : 'application/json'
      end

      def method
        @method
      end

      def url
        @url
      end

      def params
        @params
      end

      def headers
        @headers
      end

      def body
        @body
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ringcentral_sdk-1.3.4 lib/ringcentral_sdk/rest/request/simple.rb
ringcentral_sdk-1.3.3 lib/ringcentral_sdk/rest/request/simple.rb
ringcentral_sdk-1.3.2 lib/ringcentral_sdk/rest/request/simple.rb
ringcentral_sdk-1.3.1 lib/ringcentral_sdk/rest/request/simple.rb
ringcentral_sdk-1.3.0 lib/ringcentral_sdk/rest/request/simple.rb
ringcentral_sdk-1.2.3 lib/ringcentral_sdk/rest/request/simple.rb
ringcentral_sdk-1.2.2 lib/ringcentral_sdk/rest/request/simple.rb
ringcentral_sdk-1.2.1 lib/ringcentral_sdk/rest/request/simple.rb
ringcentral_sdk-1.2.0 lib/ringcentral_sdk/rest/request/simple.rb
ringcentral_sdk-1.1.1 lib/ringcentral_sdk/rest/request/simple.rb