Class: ShopifyCLI::Migrator::Migration
- Inherits:
-
Object
- Object
- ShopifyCLI::Migrator::Migration
- Defined in:
- lib/shopify_cli/migrator/migration.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #class_name ⇒ Object
-
#initialize(name:, path:, date:) ⇒ Migration
constructor
A new instance of Migration.
- #run ⇒ Object
Constructor Details
#initialize(name:, path:, date:) ⇒ Migration
Returns a new instance of Migration.
9 10 11 12 13 |
# File 'lib/shopify_cli/migrator/migration.rb', line 9 def initialize(name:, path:, date:) @name = name @path = path @date = date end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
7 8 9 |
# File 'lib/shopify_cli/migrator/migration.rb', line 7 def date @date end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/shopify_cli/migrator/migration.rb', line 7 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/shopify_cli/migrator/migration.rb', line 7 def path @path end |
Instance Method Details
#class_name ⇒ Object
22 23 24 |
# File 'lib/shopify_cli/migrator/migration.rb', line 22 def class_name name.split("_").collect(&:capitalize).join end |
#run ⇒ Object
15 16 17 18 19 20 |
# File 'lib/shopify_cli/migrator/migration.rb', line 15 def run require(path) ShopifyCLI::Migrator::Migrations.const_get(class_name).run rescue StandardError # Continue end |