Class: Migrate::Lang::Ruby
Instance Attribute Summary
Attributes inherited from Lang
Instance Method Summary collapse
- #create_migration(dir) ⇒ Object
- #exec_migration(dir, is_up) ⇒ Object
-
#initialize ⇒ Ruby
constructor
A new instance of Ruby.
Constructor Details
#initialize ⇒ Ruby
Returns a new instance of Ruby.
4 5 6 |
# File 'lib/migrate/lang/ruby.rb', line 4 def initialize @ext = "rb" end |
Instance Method Details
#create_migration(dir) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/migrate/lang/ruby.rb', line 8 def create_migration(dir) File.open("#{dir}/up.#{@ext}", "w") do |f| f.puts "# Here goes Ruby code for migration forward\n" end File.open("#{dir}/down.#{@ext}", "w") do |f| f.puts "# Here goes Ruby code for migration backward\n" end end |