Class: Karaden::Model::Requestable
Class Method Summary
collapse
-
.request(method, path, content_type = nil, params = nil, data = nil, request_options = nil) ⇒ Object
-
.request_and_return_response_interface(method, path, content_type = nil, params = nil, data = nil, request_options = nil) ⇒ Object
-
.requestor ⇒ Object
-
.requestor=(val) ⇒ Object
#id, #initialize, #object, #property, #property_keys, #set_property
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
|
.requestor ⇒ Object
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
|