Class: Intermix::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/intermix/table.rb

Constant Summary collapse

FIELDS =
%w[
  db_id
  db_name
  schema_id
  schema_name
  table_id
  table_name
  stats_pct_off
  size_pct_unsorted
  row_count
  sort_key
]

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Table

Returns a new instance of Table.

Raises:

  • (ArgumentError)


18
19
20
21
22
# File 'lib/intermix/table.rb', line 18

def initialize(data)
  raise ArgumentError, 'data cannot be nil.' unless data.present?

  self.class::FIELDS.each { |field| send("#{field}=", data[field]) }
end

Instance Method Details

#full_nameObject



24
25
26
# File 'lib/intermix/table.rb', line 24

def full_name
  "\"#{schema_name}\".\"#{table_name}\""
end