Class: ImlClient::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/iml_client/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/iml_client/result.rb', line 4

def data
  @data
end

#errorsObject (readonly)

Returns the value of attribute errors.



4
5
6
# File 'lib/iml_client/result.rb', line 4

def errors
  @errors
end

#responseObject (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