Class: ResponseModel

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeResponseModel

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

#dataObject

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

#errorObject

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

#headersObject

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_codeObject

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_attemptsObject

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_dataObject



38
39
40
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 38

def get_data
  @data
end

#get_errorObject



46
47
48
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 46

def get_error
  @error
end

#get_status_codeObject



50
51
52
# File 'lib/wingify/packages/network_layer/models/response_model.rb', line 50

def get_status_code
  @status_code
end

#get_total_attemptsObject



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