Class: BatchResponse
- Inherits:
-
Object
- Object
- BatchResponse
- Defined in:
- lib/batch_response.rb
Instance Attribute Summary collapse
-
#async ⇒ Object
Boolean processing is handled asyn.
-
#cap ⇒ Object
#return nil, integer.
-
#cap_reason ⇒ Object
String.
-
#errors ⇒ Object
Hash a list of error messages summarized by times encountered (not the objects they were on).
-
#klass ⇒ Object
Name of the class called, if used.
-
#method ⇒ Object
Name of the method called.
-
#not_updated ⇒ Object
Array ids of the objects not update.
-
#preview ⇒ Object
Boolean no writes were made.
-
#total_attempted ⇒ Object
Returns the value of attribute total_attempted.
-
#updated ⇒ Object
Array ids of the objects updated.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ BatchResponse
constructor
A new instance of BatchResponse.
- #to_json ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ BatchResponse
Returns a new instance of BatchResponse.
38 39 40 41 42 43 44 45 |
# File 'lib/batch_response.rb', line 38 def initialize(params = {}) @updated = params[:updated] || [] @not_updated = params[:not_updated] || [] @async = params[:async] || false @preview = params[:preview] || false @errors = Hash.new(0) @total_attempted = params[:total_attempted] || 0 end |
Instance Attribute Details
#async ⇒ Object
Returns Boolean processing is handled asyn.
15 16 17 |
# File 'lib/batch_response.rb', line 15 def async @async end |
#cap ⇒ Object
#return nil, integer
33 34 35 |
# File 'lib/batch_response.rb', line 33 def cap @cap end |
#cap_reason ⇒ Object
Returns String.
36 37 38 |
# File 'lib/batch_response.rb', line 36 def cap_reason @cap_reason end |
#errors ⇒ Object
Returns Hash a list of error messages summarized by times encountered (not the objects they were on).
28 29 30 |
# File 'lib/batch_response.rb', line 28 def errors @errors end |
#klass ⇒ Object
Name of the class called, if used
4 5 6 |
# File 'lib/batch_response.rb', line 4 def klass @klass end |
#method ⇒ Object
Name of the method called
7 8 9 |
# File 'lib/batch_response.rb', line 7 def method @method end |
#not_updated ⇒ Object
Returns Array ids of the objects not update.
23 24 25 |
# File 'lib/batch_response.rb', line 23 def not_updated @not_updated end |
#preview ⇒ Object
Returns Boolean no writes were made.
11 12 13 |
# File 'lib/batch_response.rb', line 11 def preview @preview end |
#total_attempted ⇒ Object
Returns the value of attribute total_attempted.
30 31 32 |
# File 'lib/batch_response.rb', line 30 def total_attempted @total_attempted end |
#updated ⇒ Object
Returns Array ids of the objects updated.
19 20 21 |
# File 'lib/batch_response.rb', line 19 def updated @updated end |
Instance Method Details
#to_json ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/batch_response.rb', line 47 def to_json { klass:, method:, preview:, async:, updated:, not_updated:, errors:, total_attempted:, cap:, cap_reason:, } end |