Class: SalesforceBulk::Batch
- Inherits:
-
Object
- Object
- SalesforceBulk::Batch
- Defined in:
- lib/salesforce_bulk/batch.rb
Instance Attribute Summary collapse
-
#apex_processing_time ⇒ Object
Returns the value of attribute apex_processing_time.
-
#api_active_processing_time ⇒ Object
Returns the value of attribute api_active_processing_time.
-
#completed_at ⇒ Object
Returns the value of attribute completed_at.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#failed_records ⇒ Object
Returns the value of attribute failed_records.
-
#id ⇒ Object
Returns the value of attribute id.
-
#job_id ⇒ Object
Returns the value of attribute job_id.
-
#processed_records ⇒ Object
Returns the value of attribute processed_records.
-
#state ⇒ Object
Returns the value of attribute state.
-
#state_message ⇒ Object
Returns the value of attribute state_message.
-
#total_processing_time ⇒ Object
Returns the value of attribute total_processing_time.
Class Method Summary collapse
Instance Method Summary collapse
- #completed? ⇒ Boolean
- #failed? ⇒ Boolean
- #in_progress? ⇒ Boolean
- #queued? ⇒ Boolean
- #state?(value) ⇒ Boolean
Instance Attribute Details
#apex_processing_time ⇒ Object
Returns the value of attribute apex_processing_time.
4 5 6 |
# File 'lib/salesforce_bulk/batch.rb', line 4 def apex_processing_time @apex_processing_time end |
#api_active_processing_time ⇒ Object
Returns the value of attribute api_active_processing_time.
5 6 7 |
# File 'lib/salesforce_bulk/batch.rb', line 5 def api_active_processing_time @api_active_processing_time end |
#completed_at ⇒ Object
Returns the value of attribute completed_at.
6 7 8 |
# File 'lib/salesforce_bulk/batch.rb', line 6 def completed_at @completed_at end |
#created_at ⇒ Object
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/salesforce_bulk/batch.rb', line 7 def created_at @created_at end |
#failed_records ⇒ Object
Returns the value of attribute failed_records.
8 9 10 |
# File 'lib/salesforce_bulk/batch.rb', line 8 def failed_records @failed_records end |
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/salesforce_bulk/batch.rb', line 9 def id @id end |
#job_id ⇒ Object
Returns the value of attribute job_id.
10 11 12 |
# File 'lib/salesforce_bulk/batch.rb', line 10 def job_id @job_id end |
#processed_records ⇒ Object
Returns the value of attribute processed_records.
11 12 13 |
# File 'lib/salesforce_bulk/batch.rb', line 11 def processed_records @processed_records end |
#state ⇒ Object
Returns the value of attribute state.
12 13 14 |
# File 'lib/salesforce_bulk/batch.rb', line 12 def state @state end |
#state_message ⇒ Object
Returns the value of attribute state_message.
13 14 15 |
# File 'lib/salesforce_bulk/batch.rb', line 13 def @state_message end |
#total_processing_time ⇒ Object
Returns the value of attribute total_processing_time.
14 15 16 |
# File 'lib/salesforce_bulk/batch.rb', line 14 def total_processing_time @total_processing_time end |
Class Method Details
.new_from_xml(data) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/salesforce_bulk/batch.rb', line 16 def self.new_from_xml(data) batch = self.new batch.id = data['id'] batch.job_id = data['jobId'] batch.state = data['state'] batch. = data['stateMessage'] batch.created_at = DateTime.parse(data['createdDate']) batch.completed_at = DateTime.parse(data['systemModstamp']) batch.processed_records = data['numberRecordsProcessed'].to_i batch.failed_records = data['numberRecordsFailed'].to_i batch.total_processing_time = data['totalProcessingTime'].to_i batch.api_active_processing_time = data['apiActiveProcessingTime'].to_i batch.apex_processing_time = data['apex_processing_time'].to_i batch end |
Instance Method Details
#completed? ⇒ Boolean
40 41 42 |
# File 'lib/salesforce_bulk/batch.rb', line 40 def completed? state? 'Completed' end |
#failed? ⇒ Boolean
44 45 46 |
# File 'lib/salesforce_bulk/batch.rb', line 44 def failed? state? 'Failed' end |
#in_progress? ⇒ Boolean
32 33 34 |
# File 'lib/salesforce_bulk/batch.rb', line 32 def in_progress? state? 'InProgress' end |
#queued? ⇒ Boolean
36 37 38 |
# File 'lib/salesforce_bulk/batch.rb', line 36 def queued? state? 'Queued' end |
#state?(value) ⇒ Boolean
48 49 50 |
# File 'lib/salesforce_bulk/batch.rb', line 48 def state?(value) !self.state.nil? && self.state.casecmp(value) == 0 end |