Class: Karaden::Model::Requestable

Inherits:
KaradenObject show all
Defined in:
lib/karaden/model/requestable.rb

Direct Known Subclasses

BulkFile, BulkMessage, Message

Class Method Summary collapse

Methods inherited from KaradenObject

#id, #initialize, #object, #property, #property_keys, #set_property

Constructor Details

This class inherits a constructor from Karaden::Model::KaradenObject

Class Method Details

.request(method, path, content_type = nil, params = nil, data = nil, request_options = nil) ⇒ Object



12
13
14
15
16
17
# File 'lib/karaden/model/requestable.rb', line 12

def self.request(method, path, content_type = nil, params = nil, data = nil, request_options = nil)
  response = @@requestor.send(method, path, content_type, params, data, request_options)
  raise response.error if response.error?

  response.object
end

.request_and_return_response_interface(method, path, content_type = nil, params = nil, data = nil, request_options = nil) ⇒ Object



19
20
21
22
23
24
# File 'lib/karaden/model/requestable.rb', line 19

def self.request_and_return_response_interface(method, path, content_type = nil, params = nil, data = nil, request_options = nil)
  response = @@requestor.send(method, path, content_type, params, data, request_options, true)
  raise response.error if response.error?

  response
end

.requestorObject



4
5
6
# File 'lib/karaden/model/requestable.rb', line 4

def self.requestor
  @@requestor
end

.requestor=(val) ⇒ Object



8
9
10
# File 'lib/karaden/model/requestable.rb', line 8

def self.requestor=(val)
  @@requestor = val
end