class CassandraSchema::MigrationDSL

Attributes

migration[R]

Public Class Methods

new(&block) click to toggle source
# File lib/cassandra-schema/migration.rb, line 21
def initialize(&block)
  @migration = Migration.new
  instance_eval(&block)
end

Public Instance Methods

down(&block) click to toggle source
# File lib/cassandra-schema/migration.rb, line 31
def down(&block)
  @buffer = []
  @migration.set_commands(:down, block.call)
end
execute(command) click to toggle source
# File lib/cassandra-schema/migration.rb, line 36
def execute(command)
  @buffer << command
end
up(&block) click to toggle source
# File lib/cassandra-schema/migration.rb, line 26
def up(&block)
  @buffer = []
  @migration.set_commands(:up, block.call)
end