Class: Ptero::Generator::ConfigGenerator
- Inherits:
-
PHPGenerator
- Object
- Ptero::Generator
- PHPGenerator
- Ptero::Generator::ConfigGenerator
- Defined in:
- lib/ptero/generators/configgenerator.rb
Overview
Generator for the config.php file
Constant Summary
Constants inherited from Ptero::Generator
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes inherited from Ptero::Generator
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ConfigGenerator
constructor
Automatically with name “config”.
-
#path ⇒ String
“config”.
Methods inherited from PHPGenerator
Methods inherited from Ptero::Generator
const_missing, #content, #content_params, #extension, #filename, #generate, #generated?, #location, #reload, #remove, #template_path, #to_s, #type
Constructor Details
#initialize(options = {}) ⇒ ConfigGenerator
Automatically with name “config”. Pass a hash of mappings to be included in the config file
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ptero/generators/configgenerator.rb', line 12 def initialize(={}) super 'config' = # Defaults [:templates_path] ||= 'views' [:controllers_path] ||= 'php/controllers' [:models_path] ||= 'php/models' [:database] ||= { name: 'database-name', user: 'username', password: 'password', server: 'localhost' } end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
29 30 31 |
# File 'lib/ptero/generators/configgenerator.rb', line 29 def end |
Instance Method Details
#path ⇒ String
Returns “config”.
31 32 33 |
# File 'lib/ptero/generators/configgenerator.rb', line 31 def path "config" end |