Class: Hive::Request::WixAPIRequest
- Inherits:
-
Object
- Object
- Hive::Request::WixAPIRequest
- Defined in:
- lib/hive/connect/request/wix_api_request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#params ⇒ Object
Returns the value of attribute params.
-
#path ⇒ Object
Returns the value of attribute path.
-
#verb ⇒ Object
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(client, verb, path, options = {}) ⇒ WixAPIRequest
constructor
A new instance of WixAPIRequest.
- #initialize_copy(_other) ⇒ Object
- #options ⇒ Object
- #perform ⇒ Object
- #perform_with_cursor(klass) ⇒ Object
- #perform_with_object(klass) ⇒ Object
Constructor Details
#initialize(client, verb, path, options = {}) ⇒ WixAPIRequest
Returns a new instance of WixAPIRequest.
11 12 13 14 15 16 17 18 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 11 def initialize(client, verb, path, = {}) @client = client @verb = verb.to_sym @path = path @body = .fetch(:body, {}) @params = .fetch(:params, {}) @headers = .fetch(:headers, {}) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
9 10 11 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 9 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
9 10 11 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 9 def headers @headers end |
#params ⇒ Object
Returns the value of attribute params.
9 10 11 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 9 def params @params end |
#path ⇒ Object
Returns the value of attribute path.
9 10 11 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 9 def path @path end |
#verb ⇒ Object
Returns the value of attribute verb.
9 10 11 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 9 def verb @verb end |
Instance Method Details
#initialize_copy(_other) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 37 def initialize_copy(_other) @path = @path.dup @body = @body.dup @params = @params.dup @headers = @headers.dup end |
#options ⇒ Object
20 21 22 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 20 def { body: @body.clone, params: @params.clone, headers: @headers.clone } end |
#perform ⇒ Object
24 25 26 27 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 24 def perform sign_request @client.wix_request(self).body end |
#perform_with_cursor(klass) ⇒ Object
33 34 35 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 33 def perform_with_cursor(klass) Hive::Cursor.new(perform, klass, self) end |
#perform_with_object(klass) ⇒ Object
29 30 31 |
# File 'lib/hive/connect/request/wix_api_request.rb', line 29 def perform_with_object(klass) klass.new(perform) end |