Class: Pictify::BatchItemStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/pictify/types.rb

Overview

Status of a single item within a batch job.

NOTE: batch results do NOT include rendered URLs — those are delivered via the render.completed webhook. Each item reports only its index, success, the variable names it used, and (on failure) an error message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ BatchItemStatus

Returns a new instance of BatchItemStatus.



131
132
133
134
135
136
137
# File 'lib/pictify/types.rb', line 131

def initialize(data)
  @raw = data
  @index = data["index"]
  @success = data["success"]
  @variables = data["variables"]
  @error = data["error"]
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



129
130
131
# File 'lib/pictify/types.rb', line 129

def error
  @error
end

#indexObject (readonly)

Returns the value of attribute index.



129
130
131
# File 'lib/pictify/types.rb', line 129

def index
  @index
end

#rawObject (readonly)

Returns the value of attribute raw.



129
130
131
# File 'lib/pictify/types.rb', line 129

def raw
  @raw
end

#successObject (readonly)

Returns the value of attribute success.



129
130
131
# File 'lib/pictify/types.rb', line 129

def success
  @success
end

#variablesObject (readonly)

Returns the value of attribute variables.



129
130
131
# File 'lib/pictify/types.rb', line 129

def variables
  @variables
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


139
140
141
# File 'lib/pictify/types.rb', line 139

def success?
  !!@success
end