Class: DataShift::GeneratorBase
- Inherits:
-
Object
- Object
- DataShift::GeneratorBase
- Includes:
- Logging
- Defined in:
- lib/generators/generator_base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
Instance Method Summary collapse
-
#generate_with_associations(file_name, klass) ⇒ Object
Prepare to generate with associations but then calls a **derived generate** method i.e abstract to this base class.
-
#initialize ⇒ GeneratorBase
constructor
A new instance of GeneratorBase.
Methods included from Logging
#logdir, #logdir=, #logger, #verbose
Constructor Details
#initialize ⇒ GeneratorBase
Returns a new instance of GeneratorBase.
15 16 |
# File 'lib/generators/generator_base.rb', line 15 def initialize end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
13 14 15 |
# File 'lib/generators/generator_base.rb', line 13 def configuration @configuration end |
Instance Method Details
#generate_with_associations(file_name, klass) ⇒ Object
Prepare to generate with associations but then calls a **derived generate** method i.e abstract to this base class
file_name => Filename for generated template
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/generators/generator_base.rb', line 23 def generate_with_associations(file_name, klass) state = DataShift::Configuration.call.with DataShift::Configuration.call.with = :all generate(file_name, klass) ensure DataShift::Configuration.call.with = state end |