Class: Pictify::BatchResults
- Inherits:
-
Object
- Object
- Pictify::BatchResults
- Defined in:
- lib/pictify/types.rb
Overview
Full status and progress of a batch job (get_batch_results).
Maps { batchId, status, progress, totalItems, completedItems, failedItems, results[], errors[], createdAt, startedAt, completedAt }.
Instance Attribute Summary collapse
-
#batch_id ⇒ Object
readonly
Returns the value of attribute batch_id.
-
#completed_at ⇒ Object
readonly
Returns the value of attribute completed_at.
-
#completed_items ⇒ Object
readonly
Returns the value of attribute completed_items.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#failed_items ⇒ Object
readonly
Returns the value of attribute failed_items.
-
#progress ⇒ Object
readonly
Returns the value of attribute progress.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#total_items ⇒ Object
readonly
Returns the value of attribute total_items.
Instance Method Summary collapse
-
#initialize(data) ⇒ BatchResults
constructor
A new instance of BatchResults.
Constructor Details
#initialize(data) ⇒ BatchResults
Returns a new instance of BatchResults.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/pictify/types.rb', line 147 def initialize(data) @raw = data @batch_id = data["batchId"] @status = data["status"] @progress = data["progress"] @total_items = data["totalItems"] @completed_items = data["completedItems"] @failed_items = data["failedItems"] @results = (data["results"] || []).map { |r| BatchItemStatus.new(r) } @errors = (data["errors"] || []).map { |e| BatchItemStatus.new(e) } @created_at = data["createdAt"] @started_at = data["startedAt"] @completed_at = data["completedAt"] end |
Instance Attribute Details
#batch_id ⇒ Object (readonly)
Returns the value of attribute batch_id.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def batch_id @batch_id end |
#completed_at ⇒ Object (readonly)
Returns the value of attribute completed_at.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def completed_at @completed_at end |
#completed_items ⇒ Object (readonly)
Returns the value of attribute completed_items.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def completed_items @completed_items end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def created_at @created_at end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def errors @errors end |
#failed_items ⇒ Object (readonly)
Returns the value of attribute failed_items.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def failed_items @failed_items end |
#progress ⇒ Object (readonly)
Returns the value of attribute progress.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def progress @progress end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def raw @raw end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def results @results end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def started_at @started_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def status @status end |
#total_items ⇒ Object (readonly)
Returns the value of attribute total_items.
143 144 145 |
# File 'lib/pictify/types.rb', line 143 def total_items @total_items end |