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.



125
126
127
128
129
130
131
# File 'lib/pictify/types.rb', line 125

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.



123
124
125
# File 'lib/pictify/types.rb', line 123

def error
  @error
end

#indexObject (readonly)

Returns the value of attribute index.



123
124
125
# File 'lib/pictify/types.rb', line 123

def index
  @index
end

#rawObject (readonly)

Returns the value of attribute raw.



123
124
125
# File 'lib/pictify/types.rb', line 123

def raw
  @raw
end

#successObject (readonly)

Returns the value of attribute success.



123
124
125
# File 'lib/pictify/types.rb', line 123

def success
  @success
end

#variablesObject (readonly)

Returns the value of attribute variables.



123
124
125
# File 'lib/pictify/types.rb', line 123

def variables
  @variables
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


133
134
135
# File 'lib/pictify/types.rb', line 133

def success?
  !!@success
end