Class: GlobalRequestModel
- Inherits:
-
Object
- Object
- GlobalRequestModel
- Defined in:
- lib/wingify/packages/network_layer/models/global_request_model.rb
Overview
Copyright 2024-2026 Wingify Software Pvt. Ltd.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#is_development_mode ⇒ Object
Returns the value of attribute is_development_mode.
-
#query ⇒ Object
Returns the value of attribute query.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#get_base_url ⇒ Object
Retrieves the base URL of the HTTP request.
-
#get_body ⇒ Object
Retrieves the body of the HTTP request.
-
#get_development_mode ⇒ Object
Retrieves the development mode status of the request.
-
#get_headers ⇒ Object
Retrieves the HTTP headers of the request.
-
#get_query ⇒ Object
Retrieves the query parameters of the HTTP request.
-
#get_timeout ⇒ Object
Retrieves the timeout duration of the HTTP request.
-
#initialize(url, query, body, headers) ⇒ GlobalRequestModel
constructor
Constructs an instance of the GlobalRequestModel.
-
#set_base_url(url) ⇒ Object
Sets the base URL of the HTTP request.
-
#set_body(body) ⇒ Object
Sets the body of the HTTP request.
-
#set_development_mode(is_development_mode) ⇒ Object
Sets the development mode status for the request.
-
#set_headers(headers) ⇒ Object
Sets the HTTP headers for the request.
-
#set_query(query) ⇒ Object
Sets the query parameters for the HTTP request.
-
#set_timeout(timeout) ⇒ Object
Sets the timeout duration for the HTTP request.
Constructor Details
#initialize(url, query, body, headers) ⇒ GlobalRequestModel
Constructs an instance of the GlobalRequestModel.
23 24 25 26 27 28 29 30 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 23 def initialize(url, query, body, headers) @url = url @query = query @body = body @headers = headers @timeout = 3000 # Default timeout in milliseconds @is_development_mode = nil # Flag to indicate if the request is in development mode end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 16 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 16 def headers @headers end |
#is_development_mode ⇒ Object
Returns the value of attribute is_development_mode.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 16 def is_development_mode @is_development_mode end |
#query ⇒ Object
Returns the value of attribute query.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 16 def query @query end |
#timeout ⇒ Object
Returns the value of attribute timeout.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 16 def timeout @timeout end |
#url ⇒ Object
Returns the value of attribute url.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 16 def url @url end |
Instance Method Details
#get_base_url ⇒ Object
Retrieves the base URL of the HTTP request.
64 65 66 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 64 def get_base_url @url end |
#get_body ⇒ Object
Retrieves the body of the HTTP request.
52 53 54 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 52 def get_body @body end |
#get_development_mode ⇒ Object
Retrieves the development mode status of the request.
100 101 102 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 100 def get_development_mode @is_development_mode end |
#get_headers ⇒ Object
Retrieves the HTTP headers of the request.
88 89 90 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 88 def get_headers @headers end |
#get_query ⇒ Object
Retrieves the query parameters of the HTTP request.
40 41 42 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 40 def get_query @query end |
#get_timeout ⇒ Object
Retrieves the timeout duration of the HTTP request.
76 77 78 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 76 def get_timeout @timeout end |
#set_base_url(url) ⇒ Object
Sets the base URL of the HTTP request.
58 59 60 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 58 def set_base_url(url) @url = url end |
#set_body(body) ⇒ Object
Sets the body of the HTTP request.
46 47 48 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 46 def set_body(body) @body = body end |
#set_development_mode(is_development_mode) ⇒ Object
Sets the development mode status for the request.
94 95 96 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 94 def set_development_mode(is_development_mode) @is_development_mode = is_development_mode end |
#set_headers(headers) ⇒ Object
Sets the HTTP headers for the request.
82 83 84 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 82 def set_headers(headers) @headers = headers end |
#set_query(query) ⇒ Object
Sets the query parameters for the HTTP request.
34 35 36 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 34 def set_query(query) @query = query end |
#set_timeout(timeout) ⇒ Object
Sets the timeout duration for the HTTP request.
70 71 72 |
# File 'lib/wingify/packages/network_layer/models/global_request_model.rb', line 70 def set_timeout(timeout) @timeout = timeout end |