Class: ImlClient::Result
- Inherits:
-
Object
- Object
- ImlClient::Result
- Defined in:
- lib/iml_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.
6 7 8 9 10 |
# File 'lib/iml_client/result.rb', line 6 def initialize(response, data, errors = []) @response = response @data = data @errors = errors end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/iml_client/result.rb', line 4 def data @data end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
4 5 6 |
# File 'lib/iml_client/result.rb', line 4 def errors @errors end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/iml_client/result.rb', line 4 def response @response end |
Instance Method Details
#add_error(error) ⇒ Object
16 17 18 |
# File 'lib/iml_client/result.rb', line 16 def add_error(error) errors.push error end |
#set_data(data) ⇒ Object
12 13 14 |
# File 'lib/iml_client/result.rb', line 12 def set_data(data) @data = data end |