Class: ResponseModel
- Inherits:
-
Object
- Object
- ResponseModel
- Defined in:
- lib/wingify/packages/network_layer/models/response_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
-
#data ⇒ Object
Returns the value of attribute data.
-
#error ⇒ Object
Returns the value of attribute error.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
-
#total_attempts ⇒ Object
Returns the value of attribute total_attempts.
Instance Method Summary collapse
- #get_data ⇒ Object
- #get_error ⇒ Object
- #get_status_code ⇒ Object
- #get_total_attempts ⇒ Object
-
#initialize ⇒ ResponseModel
constructor
A new instance of ResponseModel.
- #set_data(data) ⇒ Object
- #set_error(error) ⇒ Object
- #set_headers(headers) ⇒ Object
- #set_status_code(code) ⇒ Object
- #set_total_attempts(total_attempts) ⇒ Object
Constructor Details
#initialize ⇒ ResponseModel
Returns a new instance of ResponseModel.
18 19 20 21 22 23 24 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 18 def initialize @status_code = nil @error = nil @headers = {} @data = nil @total_attempts = 0 end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 16 def data @data end |
#error ⇒ Object
Returns the value of attribute error.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 16 def error @error end |
#headers ⇒ Object
Returns the value of attribute headers.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 16 def headers @headers end |
#status_code ⇒ Object
Returns the value of attribute status_code.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 16 def status_code @status_code end |
#total_attempts ⇒ Object
Returns the value of attribute total_attempts.
16 17 18 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 16 def total_attempts @total_attempts end |
Instance Method Details
#get_data ⇒ Object
38 39 40 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 38 def get_data @data end |
#get_error ⇒ Object
46 47 48 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 46 def get_error @error end |
#get_status_code ⇒ Object
50 51 52 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 50 def get_status_code @status_code end |
#get_total_attempts ⇒ Object
58 59 60 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 58 def get_total_attempts @total_attempts end |
#set_data(data) ⇒ Object
34 35 36 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 34 def set_data(data) @data = data end |
#set_error(error) ⇒ Object
42 43 44 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 42 def set_error(error) @error = error end |
#set_headers(headers) ⇒ Object
30 31 32 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 30 def set_headers(headers) @headers = headers end |
#set_status_code(code) ⇒ Object
26 27 28 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 26 def set_status_code(code) @status_code = code end |
#set_total_attempts(total_attempts) ⇒ Object
54 55 56 |
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 54 def set_total_attempts(total_attempts) @total_attempts = total_attempts end |