Class: Retab::ReviewAnyOf
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ReviewAnyOf
- Defined in:
- lib/retab/workflow_reviews/review_any_of.rb
Constant Summary collapse
- HASH_ATTRS =
{ kind: :kind, predicates: :predicates }.freeze
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#predicates ⇒ Object
Returns the value of attribute predicates.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ReviewAnyOf
constructor
A new instance of ReviewAnyOf.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ReviewAnyOf
Returns a new instance of ReviewAnyOf.
17 18 19 20 21 |
# File 'lib/retab/workflow_reviews/review_any_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
#kind ⇒ Object
Returns the value of attribute kind.
13 14 15 |
# File 'lib/retab/workflow_reviews/review_any_of.rb', line 13 def kind @kind end |
#predicates ⇒ Object
Returns the value of attribute predicates.
13 14 15 |
# File 'lib/retab/workflow_reviews/review_any_of.rb', line 13 def predicates @predicates end |