Class: Pocus::ResponseArray

Inherits:
Array
  • Object
show all
Defined in:
lib/pocus/resource.rb

Overview

Combine array of resources returned by API with error and warning attributes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resources, errors, warnings) ⇒ ResponseArray

Returns a new instance of ResponseArray.



6
7
8
9
10
# File 'lib/pocus/resource.rb', line 6

def initialize(resources, errors, warnings)
  @errors = (errors || [])
  @warnings = (warnings || [])
  super resources
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



4
5
6
# File 'lib/pocus/resource.rb', line 4

def errors
  @errors
end

#warningsObject (readonly)

Returns the value of attribute warnings.



4
5
6
# File 'lib/pocus/resource.rb', line 4

def warnings
  @warnings
end