Class: CdekClient::Result
- Inherits:
-
Object
- Object
- CdekClient::Result
- Defined in:
- lib/cdek_client/result.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #add_error(error) ⇒ Object
-
#initialize(response, data, errors = []) ⇒ Result
constructor
A new instance of Result.
- #set_data(data) ⇒ Object
Constructor Details
#initialize(response, data, errors = []) ⇒ Result
Returns a new instance of Result.
7 8 9 10 11 |
# File 'lib/cdek_client/result.rb', line 7 def initialize(response, data, errors = []) @response = response @data = data @errors = errors end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/cdek_client/result.rb', line 5 def data @data end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/cdek_client/result.rb', line 5 def errors @errors end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/cdek_client/result.rb', line 5 def response @response end |
Instance Method Details
#add_error(error) ⇒ Object
17 18 19 |
# File 'lib/cdek_client/result.rb', line 17 def add_error(error) errors.push error end |
#set_data(data) ⇒ Object
13 14 15 |
# File 'lib/cdek_client/result.rb', line 13 def set_data(data) @data = data end |