Class: PartialKs::ConfigurationGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/partial_ks/configuration_generator.rb

Overview

Given an initial table graph goes through each table not already in the table graph, and attempts to automatically populate the table into the table graph

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_graph, table_names: nil) ⇒ ConfigurationGenerator

Returns a new instance of ConfigurationGenerator.



7
8
9
10
# File 'lib/partial_ks/configuration_generator.rb', line 7

def initialize(table_graph, table_names: nil)
  @table_graph = table_graph
  @table_names = table_names || ActiveRecord::Base.connection.tables
end

Instance Attribute Details

#table_graphObject (readonly)

Returns the value of attribute table_graph.



5
6
7
# File 'lib/partial_ks/configuration_generator.rb', line 5

def table_graph
  @table_graph
end

#table_namesObject (readonly)

Returns the value of attribute table_names.



5
6
7
# File 'lib/partial_ks/configuration_generator.rb', line 5

def table_names
  @table_names
end

Instance Method Details

#callObject



12
13
14
# File 'lib/partial_ks/configuration_generator.rb', line 12

def call
  @filtered_tables ||= filtered_tables
end