Class: Retab::WorkflowTableRowsResponse

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

Constant Summary collapse

HASH_ATTRS =
{
  table_id: :table_id,
  columns: :columns,
  rows: :rows,
  row_count: :row_count,
  filtered_row_count: :filtered_row_count,
  offset: :offset,
  limit: :limit,
  has_more: :has_more,
  next_cursor: :next_cursor,
  previous_cursor: :previous_cursor,
  explain: :explain
}.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) ⇒ WorkflowTableRowsResponse

Returns a new instance of WorkflowTableRowsResponse.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 36

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 }
  @rows = (hash[:rows] || []).map { |item| item ? Retab::WorkflowTableRow.new(item) : nil }
  @row_count = hash[:row_count]
  @filtered_row_count = hash[:filtered_row_count]
  @offset = hash[:offset]
  @limit = hash[:limit]
  @has_more = hash[:has_more].nil? ? false : hash[:has_more]
  @next_cursor = hash[:next_cursor]
  @previous_cursor = hash[:previous_cursor]
  @explain = hash[:explain] ? Retab::WorkflowTableExplain.new(hash[:explain]) : nil
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def columns
  @columns
end

#explainObject

Returns the value of attribute explain.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def explain
  @explain
end

#filtered_row_countObject

Returns the value of attribute filtered_row_count.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def filtered_row_count
  @filtered_row_count
end

#has_moreObject

Returns the value of attribute has_more.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def has_more
  @has_more
end

#limitObject

Returns the value of attribute limit.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def limit
  @limit
end

#next_cursorObject

Returns the value of attribute next_cursor.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def next_cursor
  @next_cursor
end

#offsetObject

Returns the value of attribute offset.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def offset
  @offset
end

#previous_cursorObject

Returns the value of attribute previous_cursor.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def previous_cursor
  @previous_cursor
end

#row_countObject

Returns the value of attribute row_count.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def row_count
  @row_count
end

#rowsObject

Returns the value of attribute rows.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def rows
  @rows
end

#table_idObject

Returns the value of attribute table_id.



22
23
24
# File 'lib/retab/tables/workflow_table_rows_response.rb', line 22

def table_id
  @table_id
end