Class: Chain::BatchResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/chain/batch_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(successes: {}, errors: {}, response: nil) ⇒ BatchResponse

Returns a new instance of BatchResponse.



9
10
11
12
13
# File 'lib/chain/batch_response.rb', line 9

def initialize(successes: {}, errors: {}, response: nil)
  @successes = ensure_key_sorting(successes)
  @errors = ensure_key_sorting(errors)
  @response = response
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



19
20
21
# File 'lib/chain/batch_response.rb', line 19

def errors
  @errors
end

#responseObject (readonly)

Returns the value of attribute response.



19
20
21
# File 'lib/chain/batch_response.rb', line 19

def response
  @response
end

#successesObject (readonly)

Returns the value of attribute successes.



19
20
21
# File 'lib/chain/batch_response.rb', line 19

def successes
  @successes
end

Instance Method Details

#sizeObject



15
16
17
# File 'lib/chain/batch_response.rb', line 15

def size
  successes.size + errors.size
end