Class: DataMigrations::Instruction::Set

Inherits:
Base
  • Object
show all
Defined in:
lib/data_migrations/instruction/set.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#columns, #migration, #options

Instance Method Summary collapse

Methods inherited from Base

#execute

Constructor Details

#initialize(migration, column, value) ⇒ Set

Returns a new instance of Set.



6
7
8
9
10
# File 'lib/data_migrations/instruction/set.rb', line 6

def initialize(migration, column, value)
  super(migration)
  @column = Column.new(migration.target, column)
  @value  = value
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



4
5
6
# File 'lib/data_migrations/instruction/set.rb', line 4

def column
  @column
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/data_migrations/instruction/set.rb', line 4

def value
  @value
end

Instance Method Details

#statementsObject



12
13
14
# File 'lib/data_migrations/instruction/set.rb', line 12

def statements
  [update_statement]
end