Class: Purview::Tables::TableMetadata

Inherits:
Base show all
Defined in:
lib/purview/tables/table_metadata.rb

Instance Attribute Summary

Attributes inherited from Base

#columns, #database, #indices, #name

Instance Method Summary collapse

Methods inherited from Base

#column_names, #columns_by_name, #columns_by_source_name

Methods included from Mixins::Logger

#logger, #logger_opts, #logger_type, #with_context_logging

Methods included from Mixins::Helpers

#blank?, #coalesced, #filter_blank_values, #filter_nil_values, #present?, #timestamp, #with_timestamp, #zero?

Constructor Details

#initialize(database) ⇒ TableMetadata

Returns a new instance of TableMetadata.



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/purview/tables/table_metadata.rb', line 4

def initialize(database)
  super(
    :table_metadata,
    :columns => [
      table_name_column,
      enabled_at_column,
      last_pulled_at_column,
      locked_at_column,
      max_timestamp_pulled_column,
    ],
    :database => database
  )
end

Instance Method Details

#enabled_at_columnObject



18
19
20
# File 'lib/purview/tables/table_metadata.rb', line 18

def enabled_at_column
  Purview::Columns::Timestamp.new(:enabled_at)
end

#last_pulled_at_columnObject



22
23
24
# File 'lib/purview/tables/table_metadata.rb', line 22

def last_pulled_at_column
  Purview::Columns::Timestamp.new(:last_pulled_at)
end

#locked_at_columnObject



26
27
28
# File 'lib/purview/tables/table_metadata.rb', line 26

def locked_at_column
  Purview::Columns::Timestamp.new(:locked_at)
end

#max_timestamp_pulled_columnObject



30
31
32
# File 'lib/purview/tables/table_metadata.rb', line 30

def max_timestamp_pulled_column
  Purview::Columns::Timestamp.new(:max_timestamp_pulled)
end

#table_name_columnObject



34
35
36
37
38
39
40
# File 'lib/purview/tables/table_metadata.rb', line 34

def table_name_column
  Purview::Columns::Id.new(
    :table_name,
    :type => Purview::Types::String,
    :limit => 255,
  )
end