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