Class: Retab::WorkflowTableProfileResponse

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

Constant Summary collapse

HASH_ATTRS =
{
  table_id: :table_id,
  row_count: :row_count,
  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) ⇒ WorkflowTableProfileResponse

Returns a new instance of WorkflowTableProfileResponse.



20
21
22
23
24
25
26
# File 'lib/retab/tables/workflow_table_profile_response.rb', line 20

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

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



14
15
16
# File 'lib/retab/tables/workflow_table_profile_response.rb', line 14

def columns
  @columns
end

#row_countObject

Returns the value of attribute row_count.



14
15
16
# File 'lib/retab/tables/workflow_table_profile_response.rb', line 14

def row_count
  @row_count
end

#table_idObject

Returns the value of attribute table_id.



14
15
16
# File 'lib/retab/tables/workflow_table_profile_response.rb', line 14

def table_id
  @table_id
end