Class: MotionRecord::Schema::MigratorDefinition
- Inherits:
-
Object
- Object
- MotionRecord::Schema::MigratorDefinition
- Defined in:
- lib/motion_record/schema/migrator_definition.rb
Instance Attribute Summary collapse
-
#migrations ⇒ Object
readonly
Returns the value of attribute migrations.
Instance Method Summary collapse
-
#initialize ⇒ MigratorDefinition
constructor
A new instance of MigratorDefinition.
- #migration(version, name = nil, &block) ⇒ Object
Constructor Details
#initialize ⇒ MigratorDefinition
Returns a new instance of MigratorDefinition.
7 8 9 |
# File 'lib/motion_record/schema/migrator_definition.rb', line 7 def initialize @migrations = [] end |
Instance Attribute Details
#migrations ⇒ Object (readonly)
Returns the value of attribute migrations.
5 6 7 |
# File 'lib/motion_record/schema/migrator_definition.rb', line 5 def migrations @migrations end |
Instance Method Details
#migration(version, name = nil, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/motion_record/schema/migrator_definition.rb', line 11 def migration(version, name=nil, &block) migration_definition = Schema::MigrationDefinition.new(version, name) migration_definition.instance_eval &block @migrations << migration_definition end |