Class: Retab::ReconstructSubdocument
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ReconstructSubdocument
- Defined in:
- lib/retab/splits/reconstruct_subdocument.rb
Constant Summary collapse
- HASH_ATTRS =
{ enrichment: :enrichment, name: :name, partition_key: :partition_key, regions: :regions }.freeze
Instance Attribute Summary collapse
-
#enrichment ⇒ Object
Returns the value of attribute enrichment.
-
#name ⇒ Object
Returns the value of attribute name.
-
#partition_key ⇒ Object
Returns the value of attribute partition_key.
-
#regions ⇒ Object
Returns the value of attribute regions.
Instance Method Summary collapse
-
#initialize(json) ⇒ ReconstructSubdocument
constructor
A new instance of ReconstructSubdocument.
Constructor Details
#initialize(json) ⇒ ReconstructSubdocument
Returns a new instance of ReconstructSubdocument.
22 23 24 25 26 27 28 29 |
# File 'lib/retab/splits/reconstruct_subdocument.rb', line 22 def initialize(json) super() hash = self.class.normalize(json) @enrichment = hash[:enrichment] ? Retab::ReconstructEnrichmentOptions.new(hash[:enrichment]) : nil @name = hash[:name] @partition_key = hash[:partition_key] @regions = (hash[:regions] || []).map { |item| item ? Retab::SheetRegion.new(item) : nil } end |
Instance Attribute Details
#enrichment ⇒ Object
Returns the value of attribute enrichment.
15 16 17 |
# File 'lib/retab/splits/reconstruct_subdocument.rb', line 15 def enrichment @enrichment end |
#name ⇒ Object
Returns the value of attribute name.
15 16 17 |
# File 'lib/retab/splits/reconstruct_subdocument.rb', line 15 def name @name end |
#partition_key ⇒ Object
Returns the value of attribute partition_key.
15 16 17 |
# File 'lib/retab/splits/reconstruct_subdocument.rb', line 15 def partition_key @partition_key end |
#regions ⇒ Object
Returns the value of attribute regions.
15 16 17 |
# File 'lib/retab/splits/reconstruct_subdocument.rb', line 15 def regions @regions end |