Class: Mindee::Parsing::Common::Execution

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/parsing/common/execution.rb

Overview

Identifier for the batch to which the execution belongs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product_class, http_response) ⇒ Execution

Returns a new instance of Execution.

Parameters:

  • product_class (Mindee::Inference)
  • http_response (Hash)


52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/mindee/parsing/common/execution.rb', line 52

def initialize(product_class, http_response)
  @batch_name = http_response['batch_name']
  @created_at = Time.iso8601(http_response['created_at']) if http_response['created_at']
  @file = ExecutionFile.new(http_response['file']) if http_response['file']
  @id = http_response['id']
  @inference = product_class.new(http_response['inference']) if http_response['inference']
  @priority = Mindee::Parsing::Common::ExecutionPriority.to_priority(http_response['priority'])
  @reviewed_at = Time.iso8601(http_response['reviewed_at']) if http_response['reviewed_at']
  @available_at = Time.iso8601(http_response['available_at']) if http_response['available_at']
  if http_response['reviewed_prediction']
    @reviewed_prediction = GeneratedV1Document.new(http_response['reviewed_prediction'])
  end
  @status = http_response['status']
  @type = http_response['type']
  @uploaded_at = Time.iso8601(http_response['uploaded_at']) if http_response['uploaded_at']
  @workflow_id = http_response['workflow_id']
end

Instance Attribute Details

#available_atTime? (readonly)

The time at which the file was uploaded to a workflow.

Returns:

  • (Time, nil)


31
32
33
# File 'lib/mindee/parsing/common/execution.rb', line 31

def available_at
  @available_at
end

#batch_nameString (readonly)

Identifier for the batch to which the execution belongs.

Returns:

  • (String)


10
11
12
# File 'lib/mindee/parsing/common/execution.rb', line 10

def batch_name
  @batch_name
end

#created_atTime? (readonly)

The time at which the execution started.

Returns:

  • (Time, nil)


13
14
15
# File 'lib/mindee/parsing/common/execution.rb', line 13

def created_at
  @created_at
end

#fileExecutionFile (readonly)

File representation within a workflow execution.

Returns:



16
17
18
# File 'lib/mindee/parsing/common/execution.rb', line 16

def file
  @file
end

#idString (readonly)

Identifier for the execution.

Returns:

  • (String)


19
20
21
# File 'lib/mindee/parsing/common/execution.rb', line 19

def id
  @id
end

#inferenceMindee::Inference (readonly)

Deserialized inference object.

Returns:

  • (Mindee::Inference)


22
23
24
# File 'lib/mindee/parsing/common/execution.rb', line 22

def inference
  @inference
end

#priorityExecutionPriority (readonly)

Priority of the execution.

Returns:



25
26
27
# File 'lib/mindee/parsing/common/execution.rb', line 25

def priority
  @priority
end

#reviewed_atTime? (readonly)

The time at which the file was tagged as reviewed.

Returns:

  • (Time, nil)


28
29
30
# File 'lib/mindee/parsing/common/execution.rb', line 28

def reviewed_at
  @reviewed_at
end

#reviewed_predictionMindee::Product::Generated::GeneratedV1Document (readonly)

Reviewed fields and values.



34
35
36
# File 'lib/mindee/parsing/common/execution.rb', line 34

def reviewed_prediction
  @reviewed_prediction
end

#statusString (readonly)

Execution Status.

Returns:

  • (String)


37
38
39
# File 'lib/mindee/parsing/common/execution.rb', line 37

def status
  @status
end

#typeString (readonly)

Execution type.

Returns:

  • (String)


40
41
42
# File 'lib/mindee/parsing/common/execution.rb', line 40

def type
  @type
end

#uploaded_atTime? (readonly)

The time at which the file was uploaded to a workflow.

Returns:

  • (Time, nil)


43
44
45
# File 'lib/mindee/parsing/common/execution.rb', line 43

def uploaded_at
  @uploaded_at
end

#workflow_idString (readonly)

Identifier for the workflow.

Returns:

  • (String)


46
47
48
# File 'lib/mindee/parsing/common/execution.rb', line 46

def workflow_id
  @workflow_id
end