Class: ViewModel::Migration::Builder
- Inherits:
-
Object
- Object
- ViewModel::Migration::Builder
- Defined in:
- lib/view_model/migration.rb
Overview
Tiny DSL for defining migration classes
Instance Method Summary collapse
- #build! ⇒ Object
-
#initialize(superclass = ViewModel::Migration) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
Instance Method Details
#build! ⇒ Object
24 25 26 27 28 29 |
# File 'lib/view_model/migration.rb', line 24 def build! migration = Class.new(@superclass) migration.define_method(:up, &@up_block) if @up_block migration.define_method(:down, &@down_block) if @down_block migration end |