Class: Pineapples::Actions::Rails::CopyMigration
- Inherits:
-
CopyFile
- Object
- Action
- EmptyDirectory
- CreateFile
- CopyFile
- Pineapples::Actions::Rails::CopyMigration
- Defined in:
- lib/pineapples/actions/rails/copy_migration.rb
Constant Summary
Constants inherited from Action
Instance Attribute Summary collapse
-
#migration_name ⇒ Object
readonly
Returns the value of attribute migration_name.
Attributes inherited from CopyFile
Attributes inherited from CreateFile
Attributes inherited from EmptyDirectory
Attributes inherited from Action
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(generator, migration_name, options) ⇒ CopyMigration
constructor
A new instance of CopyMigration.
- #invoke! ⇒ Object
Methods inherited from CreateFile
Methods inherited from EmptyDirectory
Methods inherited from Action
colors, inherited, #skip?, status_color
Constructor Details
#initialize(generator, migration_name, options) ⇒ CopyMigration
Returns a new instance of CopyMigration.
22 23 24 25 26 27 28 29 30 |
# File 'lib/pineapples/actions/rails/copy_migration.rb', line 22 def initialize(generator, migration_name, ) @generator = generator @migration_name = File.basename(migration_name, File.extname(migration_name)) set_source_for_migration! @target = target_for_migration super(generator, @source, @target, ) end |
Instance Attribute Details
#migration_name ⇒ Object (readonly)
Returns the value of attribute migration_name.
12 13 14 |
# File 'lib/pineapples/actions/rails/copy_migration.rb', line 12 def migration_name @migration_name end |
Class Method Details
.time ⇒ Object
14 15 16 |
# File 'lib/pineapples/actions/rails/copy_migration.rb', line 14 def self.time @time ||= Time.now end |
.time=(value) ⇒ Object
18 19 20 |
# File 'lib/pineapples/actions/rails/copy_migration.rb', line 18 def self.time=(value) @time = value end |
Instance Method Details
#invoke! ⇒ Object
32 33 34 35 |
# File 'lib/pineapples/actions/rails/copy_migration.rb', line 32 def invoke! super self.class.time = self.class.time + 2 end |