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
34 35 36 37 38 39 |
# File 'lib/view_model/migration.rb', line 34 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 |