class DbToFile::Config
Public Class Methods
instance()
click to toggle source
# File lib/db_to_file/config.rb, line 7 def self.instance @@instance ||= new end
new()
click to toggle source
# File lib/db_to_file/config.rb, line 11 def initialize @data = load_config end
Public Instance Methods
data()
click to toggle source
# File lib/db_to_file/config.rb, line 43 def data @data end
directory_prefix(table_name)
click to toggle source
# File lib/db_to_file/config.rb, line 35 def directory_prefix(table_name) begin data['tables'][table_name]['directory_prefix'] rescue NoMethodError nil end end
field_extension(table_name, field_name)
click to toggle source
# File lib/db_to_file/config.rb, line 19 def field_extension(table_name, field_name) begin data['tables'][table_name]['field_extensions'][field_name] rescue NoMethodError nil end end
ignore_columns(table_name)
click to toggle source
# File lib/db_to_file/config.rb, line 27 def ignore_columns(table_name) begin data['tables'][table_name]['ignore_columns'] rescue NoMethodError nil end end
tables()
click to toggle source
# File lib/db_to_file/config.rb, line 15 def tables data['tables'].keys end
Private Instance Methods
config_file()
click to toggle source
# File lib/db_to_file/config.rb, line 52 def config_file 'config/db_to_file.yml' end
load_config()
click to toggle source
# File lib/db_to_file/config.rb, line 48 def load_config YAML::load(File.read(config_file)) end