Class: GammaReplication::Parser::DataParser

Inherits:
Object
  • Object
show all
Defined in:
lib/gamma_replication/parser/data_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(data_yaml_path, hook_root_dir, in_client, out_client, apply: false) ⇒ DataParser

Returns a new instance of DataParser.



6
7
8
9
10
11
12
# File 'lib/gamma_replication/parser/data_parser.rb', line 6

def initialize(data_yaml_path, hook_root_dir, in_client, out_client, apply: false)
  @data_settings = YAML.load_file(data_yaml_path).map(&:with_indifferent_access)
  @hook_root_dir = hook_root_dir
  @in_client = in_client
  @out_client = out_client
  @apply = apply
end

Instance Method Details

#gamma_tablesObject



14
15
16
17
# File 'lib/gamma_replication/parser/data_parser.rb', line 14

def gamma_tables
  exist_tables = database_exist_tables
  @data_settings.flat_map { |d| parse_data_settings(d[:data], exist_tables) }
end