Class: RingCentralSdk::REST::Request::Simple
- Defined in:
- lib/ringcentral_sdk/rest/request/simple.rb
Instance Method Summary collapse
- #body ⇒ Object
- #content_type ⇒ Object
- #headers ⇒ Object
-
#initialize(opts = {}) ⇒ Simple
constructor
A new instance of Simple.
- #method ⇒ Object
- #params ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Simple
Returns a new instance of Simple.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ringcentral_sdk/rest/request/simple.rb', line 3 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 |
Instance Method Details
#body ⇒ Object
35 36 37 |
# File 'lib/ringcentral_sdk/rest/request/simple.rb', line 35 def body @body end |
#content_type ⇒ Object
14 15 16 17 |
# File 'lib/ringcentral_sdk/rest/request/simple.rb', line 14 def content_type ct = @headers.is_a?(Hash) \ ? @headers['Content-Type'] || '' : 'application/json' end |
#headers ⇒ Object
31 32 33 |
# File 'lib/ringcentral_sdk/rest/request/simple.rb', line 31 def headers @headers end |
#method ⇒ Object
19 20 21 |
# File 'lib/ringcentral_sdk/rest/request/simple.rb', line 19 def method @method end |
#params ⇒ Object
27 28 29 |
# File 'lib/ringcentral_sdk/rest/request/simple.rb', line 27 def params @params end |
#url ⇒ Object
23 24 25 |
# File 'lib/ringcentral_sdk/rest/request/simple.rb', line 23 def url @url end |