Class: Retab::WorkflowTableValidationResponse

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/tables/workflow_table_validation_response.rb

Constant Summary collapse

HASH_ATTRS =
{
  table_id: :table_id,
  diagnostics: :diagnostics,
  has_errors: :has_errors
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowTableValidationResponse

Returns a new instance of WorkflowTableValidationResponse.



20
21
22
23
24
25
26
27
28
# File 'lib/retab/tables/workflow_table_validation_response.rb', line 20

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @table_id = hash[:table_id]
  @diagnostics = (hash[:diagnostics] || []).map { |item|
    item ? Retab::WorkflowTableValidationDiagnostic.new(item) : nil
  }
  @has_errors = hash[:has_errors].nil? ? false : hash[:has_errors]
end

Instance Attribute Details

#diagnosticsObject

Returns the value of attribute diagnostics.



14
15
16
# File 'lib/retab/tables/workflow_table_validation_response.rb', line 14

def diagnostics
  @diagnostics
end

#has_errorsObject

Returns the value of attribute has_errors.



14
15
16
# File 'lib/retab/tables/workflow_table_validation_response.rb', line 14

def has_errors
  @has_errors
end

#table_idObject

Returns the value of attribute table_id.



14
15
16
# File 'lib/retab/tables/workflow_table_validation_response.rb', line 14

def table_id
  @table_id
end