Class: Nandi::Instructions::AddReference

Inherits:
Object
  • Object
show all
Defined in:
lib/nandi/instructions/add_reference.rb

Constant Summary collapse

DEFAULT_EXTRA_ARGS =
{ index: false }.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table:, ref_name:, **kwargs) ⇒ AddReference

Returns a new instance of AddReference.



9
10
11
12
13
# File 'lib/nandi/instructions/add_reference.rb', line 9

def initialize(table:, ref_name:, **kwargs)
  @table = table
  @ref_name = ref_name
  @extra_args = DEFAULT_EXTRA_ARGS.merge(kwargs)
end

Instance Attribute Details

#extra_argsObject (readonly)

Returns the value of attribute extra_args.



7
8
9
# File 'lib/nandi/instructions/add_reference.rb', line 7

def extra_args
  @extra_args
end

#ref_nameObject (readonly)

Returns the value of attribute ref_name.



7
8
9
# File 'lib/nandi/instructions/add_reference.rb', line 7

def ref_name
  @ref_name
end

#tableObject (readonly)

Returns the value of attribute table.



7
8
9
# File 'lib/nandi/instructions/add_reference.rb', line 7

def table
  @table
end

Instance Method Details

#lockObject



19
20
21
# File 'lib/nandi/instructions/add_reference.rb', line 19

def lock
  Nandi::Migration::LockWeights::ACCESS_EXCLUSIVE
end

#procedureObject



15
16
17
# File 'lib/nandi/instructions/add_reference.rb', line 15

def procedure
  :add_reference
end