Class: Retab::WorkflowDiagnosisResponse

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

Constant Summary collapse

HASH_ATTRS =
{
  is_valid: :is_valid,
  issues: :issues,
  suggestions: :suggestions,
  stats: :stats
}.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) ⇒ WorkflowDiagnosisResponse

Returns a new instance of WorkflowDiagnosisResponse.



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

def initialize(json)
  hash = self.class.normalize(json)
  @is_valid = hash[:is_valid]
  @issues = (hash[:issues] || []).map { |item| item ? Retab::WorkflowDiagnosisIssue.new(item) : nil }
  @suggestions = (hash[:suggestions] || [])
  @stats = hash[:stats] ? Retab::WorkflowDiagnosisStats.new(hash[:stats]) : nil
end

Instance Attribute Details

#is_validObject

Returns the value of attribute is_valid.



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

def is_valid
  @is_valid
end

#issuesObject

Returns the value of attribute issues.



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

def issues
  @issues
end

#statsObject

Returns the value of attribute stats.



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

def stats
  @stats
end

#suggestionsObject

Returns the value of attribute suggestions.



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

def suggestions
  @suggestions
end