Class: Pictify::BatchResults

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_idObject (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_atObject (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_itemsObject (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_atObject (readonly)

Returns the value of attribute created_at.



143
144
145
# File 'lib/pictify/types.rb', line 143

def created_at
  @created_at
end

#errorsObject (readonly)

Returns the value of attribute errors.



143
144
145
# File 'lib/pictify/types.rb', line 143

def errors
  @errors
end

#failed_itemsObject (readonly)

Returns the value of attribute failed_items.



143
144
145
# File 'lib/pictify/types.rb', line 143

def failed_items
  @failed_items
end

#progressObject (readonly)

Returns the value of attribute progress.



143
144
145
# File 'lib/pictify/types.rb', line 143

def progress
  @progress
end

#rawObject (readonly)

Returns the value of attribute raw.



143
144
145
# File 'lib/pictify/types.rb', line 143

def raw
  @raw
end

#resultsObject (readonly)

Returns the value of attribute results.



143
144
145
# File 'lib/pictify/types.rb', line 143

def results
  @results
end

#started_atObject (readonly)

Returns the value of attribute started_at.



143
144
145
# File 'lib/pictify/types.rb', line 143

def started_at
  @started_at
end

#statusObject (readonly)

Returns the value of attribute status.



143
144
145
# File 'lib/pictify/types.rb', line 143

def status
  @status
end

#total_itemsObject (readonly)

Returns the value of attribute total_items.



143
144
145
# File 'lib/pictify/types.rb', line 143

def total_items
  @total_items
end