Class: Retab::SourcesResponse
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::SourcesResponse
- Defined in:
- lib/retab/extractions/sources_response.rb
Constant Summary collapse
- HASH_ATTRS =
{ object: :object, extraction_id: :extraction_id, document_type: :document_type, file: :file, extraction: :extraction, sources: :sources }.freeze
Instance Attribute Summary collapse
-
#document_type ⇒ Object
Returns the value of attribute document_type.
-
#extraction ⇒ Object
Returns the value of attribute extraction.
-
#extraction_id ⇒ Object
Returns the value of attribute extraction_id.
-
#file ⇒ Object
Returns the value of attribute file.
-
#object ⇒ Object
Returns the value of attribute object.
-
#sources ⇒ Object
Returns the value of attribute sources.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ SourcesResponse
constructor
A new instance of SourcesResponse.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ SourcesResponse
Returns a new instance of SourcesResponse.
25 26 27 28 29 30 31 32 33 |
# File 'lib/retab/extractions/sources_response.rb', line 25 def initialize(json) hash = self.class.normalize(json) @object = hash[:object] @extraction_id = hash[:extraction_id] @document_type = hash[:document_type] @file = hash[:file] ? Retab::FileRef.new(hash[:file]) : nil @extraction = hash[:extraction] || {} @sources = hash[:sources] || {} end |
Instance Attribute Details
#document_type ⇒ Object
Returns the value of attribute document_type.
17 18 19 |
# File 'lib/retab/extractions/sources_response.rb', line 17 def document_type @document_type end |
#extraction ⇒ Object
Returns the value of attribute extraction.
17 18 19 |
# File 'lib/retab/extractions/sources_response.rb', line 17 def extraction @extraction end |
#extraction_id ⇒ Object
Returns the value of attribute extraction_id.
17 18 19 |
# File 'lib/retab/extractions/sources_response.rb', line 17 def extraction_id @extraction_id end |
#file ⇒ Object
Returns the value of attribute file.
17 18 19 |
# File 'lib/retab/extractions/sources_response.rb', line 17 def file @file end |
#object ⇒ Object
Returns the value of attribute object.
17 18 19 |
# File 'lib/retab/extractions/sources_response.rb', line 17 def object @object end |
#sources ⇒ Object
Returns the value of attribute sources.
17 18 19 |
# File 'lib/retab/extractions/sources_response.rb', line 17 def sources @sources end |