Class: Retab::WorkflowTable
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::WorkflowTable
- Defined in:
- lib/retab/tables/workflow_table.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, name: :name, filename: :filename, source_file_id: :source_file_id, snapshot_file_id: :snapshot_file_id, row_count: :row_count, columns: :columns, sample_rows: :sample_rows, metadata: :metadata, uploaded_by_user_id: :uploaded_by_user_id, created_at: :created_at, updated_at: :updated_at }.freeze
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#id ⇒ Object
Returns the value of attribute id.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
-
#row_count ⇒ Object
Returns the value of attribute row_count.
-
#sample_rows ⇒ Object
Returns the value of attribute sample_rows.
-
#snapshot_file_id ⇒ Object
Returns the value of attribute snapshot_file_id.
-
#source_file_id ⇒ Object
Returns the value of attribute source_file_id.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#uploaded_by_user_id ⇒ Object
Returns the value of attribute uploaded_by_user_id.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ WorkflowTable
constructor
A new instance of WorkflowTable.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ WorkflowTable
Returns a new instance of WorkflowTable.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/retab/tables/workflow_table.rb', line 38 def initialize(json) super() hash = self.class.normalize(json) @id = hash[:id] @name = hash[:name] @filename = hash[:filename] @source_file_id = hash[:source_file_id].nil? ? "" : hash[:source_file_id] @snapshot_file_id = hash[:snapshot_file_id].nil? ? "" : hash[:snapshot_file_id] @row_count = hash[:row_count] @columns = (hash[:columns] || []).map { |item| item ? Retab::WorkflowTableColumn.new(item) : nil } @sample_rows = (hash[:sample_rows] || []).map { |item| item || {} } @metadata = hash[:metadata] || {} @uploaded_by_user_id = hash[:uploaded_by_user_id] @created_at = hash[:created_at] @updated_at = hash[:updated_at] end |
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def columns @columns end |
#created_at ⇒ Object
Returns the value of attribute created_at.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def created_at @created_at end |
#filename ⇒ Object
Returns the value of attribute filename.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def filename @filename end |
#id ⇒ Object
Returns the value of attribute id.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def id @id end |
#metadata ⇒ Object
Returns the value of attribute metadata.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def @metadata end |
#name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def name @name end |
#row_count ⇒ Object
Returns the value of attribute row_count.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def row_count @row_count end |
#sample_rows ⇒ Object
Returns the value of attribute sample_rows.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def sample_rows @sample_rows end |
#snapshot_file_id ⇒ Object
Returns the value of attribute snapshot_file_id.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def snapshot_file_id @snapshot_file_id end |
#source_file_id ⇒ Object
Returns the value of attribute source_file_id.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def source_file_id @source_file_id end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def updated_at @updated_at end |
#uploaded_by_user_id ⇒ Object
Returns the value of attribute uploaded_by_user_id.
23 24 25 |
# File 'lib/retab/tables/workflow_table.rb', line 23 def uploaded_by_user_id @uploaded_by_user_id end |