Class: Retab::ReviewAllOf

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_reviews/review_all_of.rb

Constant Summary collapse

HASH_ATTRS =
{
  kind: :kind,
  predicates: :predicates
}.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) ⇒ ReviewAllOf

Returns a new instance of ReviewAllOf.



17
18
19
20
21
# File 'lib/retab/workflow_reviews/review_all_of.rb', line 17

def initialize(json)
  hash = self.class.normalize(json)
  @kind = hash[:kind]
  @predicates = (hash[:predicates] || []).map { |item| item ? (case item[:kind] when "all_of" then Retab::ReviewAllOf.new(item) when "always" then Retab::ReviewAlways.new(item) when "any_of" then Retab::ReviewAnyOf.new(item) when "any_required_field_null" then Retab::ReviewAnyRequiredFieldNull.new(item) when "any_split_pages_lt" then Retab::ReviewAnySplitPagesLt.new(item) when "boundary_confidence_lt" then Retab::ReviewBoundaryConfidenceLt.new(item) when "branch_in" then Retab::ReviewBranchIn.new(item) when "category_in" then Retab::ReviewCategoryIn.new(item) when "confidence_lt" then Retab::ReviewConfidenceLt.new(item) when "field_confidence_lt" then Retab::ReviewFieldConfidenceLt.new(item) when "json_condition" then Retab::ReviewJsonCondition.new(item) when "split_count_neq" then Retab::ReviewSplitCountNeq.new(item) when "top_margin_lt" then Retab::ReviewTopMarginLt.new(item) when "validation_failed" then Retab::ReviewValidationFailed.new(item) else item end) : nil }
end

Instance Attribute Details

#kindObject

Returns the value of attribute kind.



13
14
15
# File 'lib/retab/workflow_reviews/review_all_of.rb', line 13

def kind
  @kind
end

#predicatesObject

Returns the value of attribute predicates.



13
14
15
# File 'lib/retab/workflow_reviews/review_all_of.rb', line 13

def predicates
  @predicates
end