Class: SalesforceBulk::BatchResultCollection
- Inherits:
-
Array
- Object
- Array
- SalesforceBulk::BatchResultCollection
- Defined in:
- lib/salesforce_bulk/batch_result_collection.rb
Instance Attribute Summary collapse
-
#batch_id ⇒ Object
readonly
Returns the value of attribute batch_id.
-
#job_id ⇒ Object
readonly
Returns the value of attribute job_id.
Instance Method Summary collapse
- #any_failures? ⇒ Boolean
- #completed ⇒ Object
- #created ⇒ Object
- #failed ⇒ Object
-
#initialize(job_id, batch_id) ⇒ BatchResultCollection
constructor
A new instance of BatchResultCollection.
Constructor Details
#initialize(job_id, batch_id) ⇒ BatchResultCollection
Returns a new instance of BatchResultCollection.
7 8 9 10 |
# File 'lib/salesforce_bulk/batch_result_collection.rb', line 7 def initialize(job_id, batch_id) @job_id = job_id @batch_id = batch_id end |
Instance Attribute Details
#batch_id ⇒ Object (readonly)
Returns the value of attribute batch_id.
4 5 6 |
# File 'lib/salesforce_bulk/batch_result_collection.rb', line 4 def batch_id @batch_id end |
#job_id ⇒ Object (readonly)
Returns the value of attribute job_id.
5 6 7 |
# File 'lib/salesforce_bulk/batch_result_collection.rb', line 5 def job_id @job_id end |
Instance Method Details
#any_failures? ⇒ Boolean
12 13 14 |
# File 'lib/salesforce_bulk/batch_result_collection.rb', line 12 def any_failures? self.any? { |result| result.error.length > 0 } end |
#completed ⇒ Object
20 21 22 |
# File 'lib/salesforce_bulk/batch_result_collection.rb', line 20 def completed self.select { |result| result.success } end |
#created ⇒ Object
24 25 26 |
# File 'lib/salesforce_bulk/batch_result_collection.rb', line 24 def created self.select { |result| result.success && result.created } end |
#failed ⇒ Object
16 17 18 |
# File 'lib/salesforce_bulk/batch_result_collection.rb', line 16 def failed self.select { |result| result.error.length > 0 } end |