Class: Retab::WorkflowTableSchemaResponse

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/tables/workflow_table_schema_response.rb

Constant Summary collapse

HASH_ATTRS =
{
  table_id: :table_id,
  columns: :columns
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowTableSchemaResponse

Returns a new instance of WorkflowTableSchemaResponse.



18
19
20
21
22
23
# File 'lib/retab/tables/workflow_table_schema_response.rb', line 18

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @table_id = hash[:table_id]
  @columns = (hash[:columns] || []).map { |item| item ? Retab::WorkflowTableColumn.new(item) : nil }
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



13
14
15
# File 'lib/retab/tables/workflow_table_schema_response.rb', line 13

def columns
  @columns
end

#table_idObject

Returns the value of attribute table_id.



13
14
15
# File 'lib/retab/tables/workflow_table_schema_response.rb', line 13

def table_id
  @table_id
end