Class: Retab::Review
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::Review
- Defined in:
- lib/retab/workflow_reviews/review.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, workflow_id: :workflow_id, workflow_version_id: :workflow_version_id, workflow_run_id: :workflow_run_id, block_id: :block_id, step_id: :step_id, parent_step_id: :parent_step_id, iteration_key: :iteration_key, block_type: :block_type, triggered_by: :triggered_by, created_at: :created_at, decision: :decision }.freeze
Instance Attribute Summary collapse
-
#block_id ⇒ Object
Returns the value of attribute block_id.
-
#block_type ⇒ Object
Returns the value of attribute block_type.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#decision ⇒ Object
Returns the value of attribute decision.
-
#id ⇒ Object
Returns the value of attribute id.
-
#iteration_key ⇒ Object
Returns the value of attribute iteration_key.
-
#parent_step_id ⇒ Object
Returns the value of attribute parent_step_id.
-
#step_id ⇒ Object
Returns the value of attribute step_id.
-
#triggered_by ⇒ Object
Returns the value of attribute triggered_by.
-
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
-
#workflow_run_id ⇒ Object
Returns the value of attribute workflow_run_id.
-
#workflow_version_id ⇒ Object
Returns the value of attribute workflow_version_id.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ Review
constructor
A new instance of Review.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ Review
Returns a new instance of Review.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/retab/workflow_reviews/review.rb', line 38 def initialize(json) super() hash = self.class.normalize(json) @id = hash[:id] @workflow_id = hash[:workflow_id] @workflow_version_id = hash[:workflow_version_id] @workflow_run_id = hash[:workflow_run_id] @block_id = hash[:block_id] @step_id = hash[:step_id] @parent_step_id = hash[:parent_step_id] @iteration_key = hash[:iteration_key] @block_type = hash[:block_type] @triggered_by = hash[:triggered_by] ? ( case hash[:triggered_by][:kind] when "all_of" Retab::ReviewAllOf.new(hash[:triggered_by]) when "always" Retab::ReviewAlways.new(hash[:triggered_by]) when "any_of" Retab::ReviewAnyOf.new(hash[:triggered_by]) when "any_required_field_null" Retab::ReviewAnyRequiredFieldNull.new(hash[:triggered_by]) when "any_split_pages_lt" Retab::ReviewAnySplitPagesLt.new(hash[:triggered_by]) when "boundary_confidence_lt" Retab::ReviewBoundaryConfidenceLt.new(hash[:triggered_by]) when "branch_in" Retab::ReviewBranchIn.new(hash[:triggered_by]) when "category_in" Retab::ReviewCategoryIn.new(hash[:triggered_by]) when "confidence_lt" Retab::ReviewConfidenceLt.new(hash[:triggered_by]) when "field_confidence_lt" Retab::ReviewFieldConfidenceLt.new(hash[:triggered_by]) when "json_condition" Retab::ReviewJsonCondition.new(hash[:triggered_by]) when "split_count_neq" Retab::ReviewSplitCountNeq.new(hash[:triggered_by]) when "top_margin_lt" Retab::ReviewTopMarginLt.new(hash[:triggered_by]) when "validation_failed" Retab::ReviewValidationFailed.new(hash[:triggered_by]) else hash[:triggered_by] end ) : nil @created_at = hash[:created_at] @decision = hash[:decision] ? Retab::ReviewDecision.new(hash[:decision]) : nil end |
Instance Attribute Details
#block_id ⇒ Object
Returns the value of attribute block_id.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def block_id @block_id end |
#block_type ⇒ Object
Returns the value of attribute block_type.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def block_type @block_type end |
#created_at ⇒ Object
Returns the value of attribute created_at.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def created_at @created_at end |
#decision ⇒ Object
Returns the value of attribute decision.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def decision @decision end |
#id ⇒ Object
Returns the value of attribute id.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def id @id end |
#iteration_key ⇒ Object
Returns the value of attribute iteration_key.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def iteration_key @iteration_key end |
#parent_step_id ⇒ Object
Returns the value of attribute parent_step_id.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def parent_step_id @parent_step_id end |
#step_id ⇒ Object
Returns the value of attribute step_id.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def step_id @step_id end |
#triggered_by ⇒ Object
Returns the value of attribute triggered_by.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def triggered_by @triggered_by end |
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def workflow_id @workflow_id end |
#workflow_run_id ⇒ Object
Returns the value of attribute workflow_run_id.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def workflow_run_id @workflow_run_id end |
#workflow_version_id ⇒ Object
Returns the value of attribute workflow_version_id.
23 24 25 |
# File 'lib/retab/workflow_reviews/review.rb', line 23 def workflow_version_id @workflow_version_id end |