Class: Trokko::Scaffolders::Config::Database
- Inherits:
-
Object
- Object
- Trokko::Scaffolders::Config::Database
- Defined in:
- lib/trokko/scaffolders/config/database.rb
Overview
Generating config/database.yml file according to configurations
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#thor ⇒ Object
readonly
Returns the value of attribute thor.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(db:, thor:) ⇒ Database
constructor
A new instance of Database.
Constructor Details
#initialize(db:, thor:) ⇒ Database
Returns a new instance of Database.
10 11 12 13 |
# File 'lib/trokko/scaffolders/config/database.rb', line 10 def initialize(db:, thor:) @db = db @thor = thor end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
8 9 10 |
# File 'lib/trokko/scaffolders/config/database.rb', line 8 def db @db end |
#thor ⇒ Object (readonly)
Returns the value of attribute thor.
8 9 10 |
# File 'lib/trokko/scaffolders/config/database.rb', line 8 def thor @thor end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/trokko/scaffolders/config/database.rb', line 15 def generate thor.template( 'templates/config/database.yml.erb', "#{thor.name}/config/database.yml", force: true, context: binding ) end |