Class: Syncano::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/syncano/response.rb

Overview

Represents response from Syncano API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status = false, data = nil, errors = []) ⇒ Response

Constructor for Syncano::Response

Parameters:

  • status (Boolean) (defaults to: false)
  • data (Hash) (defaults to: nil)
  • errors (Array) (defaults to: [])


10
11
12
13
14
15
16
# File 'lib/syncano/response.rb', line 10

def initialize(status = false, data = nil, errors = [])
  super()

  self.status = status
  self.data   = data
  self.errors = errors
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



4
5
6
# File 'lib/syncano/response.rb', line 4

def data
  @data
end

#errorsObject

Returns the value of attribute errors.



4
5
6
# File 'lib/syncano/response.rb', line 4

def errors
  @errors
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/syncano/response.rb', line 4

def status
  @status
end