Class: DbSeeder::Generator
- Inherits:
-
Object
- Object
- DbSeeder::Generator
- Defined in:
- lib/db_seeder/generator.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #generate(table_name = nil) ⇒ Object
-
#initialize(config, options = {}) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(config, options = {}) ⇒ Generator
Returns a new instance of Generator.
9 10 11 12 |
# File 'lib/db_seeder/generator.rb', line 9 def initialize(config, = {}) @config = config = end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/db_seeder/generator.rb', line 7 def config @config end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/db_seeder/generator.rb', line 7 def end |
Instance Method Details
#generate(table_name = nil) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/db_seeder/generator.rb', line 14 def generate(table_name = nil) tables = table_name ? [table_name] : fetch_tables tables.each do |table| export_table(table) end end |