Class: Retab::EditResult

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_artifacts/edit_result.rb

Constant Summary collapse

HASH_ATTRS =
{
  form_data: :form_data,
  filled_document: :filled_document
}.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) ⇒ EditResult

Returns a new instance of EditResult.



17
18
19
20
21
# File 'lib/retab/workflow_artifacts/edit_result.rb', line 17

def initialize(json)
  hash = self.class.normalize(json)
  @form_data = (hash[:form_data] || []).map { |item| item ? Retab::FormField.new(item) : nil }
  @filled_document = hash[:filled_document] ? Retab::MimeData.new(hash[:filled_document]) : nil
end

Instance Attribute Details

#filled_documentObject

Returns the value of attribute filled_document.



13
14
15
# File 'lib/retab/workflow_artifacts/edit_result.rb', line 13

def filled_document
  @filled_document
end

#form_dataObject

Returns the value of attribute form_data.



13
14
15
# File 'lib/retab/workflow_artifacts/edit_result.rb', line 13

def form_data
  @form_data
end