Class: Retab::WorkflowDiagnosisStats

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflows/workflow_diagnosis_stats.rb

Constant Summary collapse

HASH_ATTRS =
{
  total_blocks: :total_blocks,
  total_edges: :total_edges,
  block_types: :block_types,
  start_document_blocks: :start_document_blocks
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowDiagnosisStats

Returns a new instance of WorkflowDiagnosisStats.



21
22
23
24
25
26
27
# File 'lib/retab/workflows/workflow_diagnosis_stats.rb', line 21

def initialize(json)
  hash = self.class.normalize(json)
  @total_blocks = hash[:total_blocks]
  @total_edges = hash[:total_edges]
  @block_types = hash[:block_types] || {}
  @start_document_blocks = hash[:start_document_blocks]
end

Instance Attribute Details

#block_typesObject

Returns the value of attribute block_types.



15
16
17
# File 'lib/retab/workflows/workflow_diagnosis_stats.rb', line 15

def block_types
  @block_types
end

#start_document_blocksObject

Returns the value of attribute start_document_blocks.



15
16
17
# File 'lib/retab/workflows/workflow_diagnosis_stats.rb', line 15

def start_document_blocks
  @start_document_blocks
end

#total_blocksObject

Returns the value of attribute total_blocks.



15
16
17
# File 'lib/retab/workflows/workflow_diagnosis_stats.rb', line 15

def total_blocks
  @total_blocks
end

#total_edgesObject

Returns the value of attribute total_edges.



15
16
17
# File 'lib/retab/workflows/workflow_diagnosis_stats.rb', line 15

def total_edges
  @total_edges
end