Module: Atchu
- Extended by:
- Atchu
- Included in:
- Atchu
- Defined in:
- lib/atchu.rb,
lib/atchu/queries.rb,
lib/atchu/connection.rb,
lib/atchu/model_file_maker.rb
Defined Under Namespace
Modules: Connection, Queries
Classes: ModelFileMaker
Instance Method Summary
collapse
Instance Method Details
#for_db(db_config) ⇒ Object
8
9
10
11
|
# File 'lib/atchu.rb', line 8
def for_db db_config
Connection.connect db_config
self
end
|
#generate_models_at(output_folder) ⇒ Object
13
14
15
16
17
|
# File 'lib/atchu.rb', line 13
def generate_models_at output_folder
tables = Connection.get.tables
models = tables.map{|table| Model.for_table(table)}
models.each{|model|ModelFileMaker.new(model).write_to output_folder}
end
|