Class: Kafo::MigrationContext
- Inherits:
-
BaseContext
- Object
- BaseContext
- Kafo::MigrationContext
- Defined in:
- lib/kafo/migration_context.rb
Instance Attribute Summary collapse
-
#answers ⇒ Object
Returns the value of attribute answers.
-
#scenario ⇒ Object
Returns the value of attribute scenario.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(scenario, answers) ⇒ MigrationContext
constructor
A new instance of MigrationContext.
- #logger ⇒ Object
Methods inherited from BaseContext
Constructor Details
#initialize(scenario, answers) ⇒ MigrationContext
Returns a new instance of MigrationContext.
14 15 16 17 |
# File 'lib/kafo/migration_context.rb', line 14 def initialize(scenario, answers) @scenario = scenario @answers = answers end |
Instance Attribute Details
#answers ⇒ Object
Returns the value of attribute answers.
6 7 8 |
# File 'lib/kafo/migration_context.rb', line 6 def answers @answers end |
#scenario ⇒ Object
Returns the value of attribute scenario.
6 7 8 |
# File 'lib/kafo/migration_context.rb', line 6 def scenario @scenario end |
Class Method Details
.execute(scenario, answers, &migration) ⇒ Object
8 9 10 11 12 |
# File 'lib/kafo/migration_context.rb', line 8 def self.execute(scenario, answers, &migration) context = new(scenario, answers) context.instance_eval(&migration) return context.scenario, context.answers end |
Instance Method Details
#logger ⇒ Object
19 20 21 |
# File 'lib/kafo/migration_context.rb', line 19 def logger KafoConfigure.logger end |