Class: Gizzard::Transformation::Op::RemoveLink

Inherits:
LinkOp
  • Object
show all
Defined in:
lib/gizzard/transformation_op.rb

Instance Attribute Summary

Attributes inherited from LinkOp

#from, #to

Instance Method Summary collapse

Methods inherited from LinkOp

#eql?, #initialize, #inverse?

Methods inherited from BaseOp

#<=>, #eql?, #inspect, #inverse?, #involved_shards

Constructor Details

This class inherits a constructor from Gizzard::Transformation::Op::LinkOp

Instance Method Details

#apply(nameserver, table_id, base_id, table_prefix, translations) ⇒ Object



136
137
138
139
140
141
# File 'lib/gizzard/transformation_op.rb', line 136

def apply(nameserver, table_id, base_id, table_prefix, translations)
  from_shard_id = from.to_shard_id(table_prefix, translations)
  to_shard_id   = to.to_shard_id(table_prefix, translations)

  nameserver.remove_link(from_shard_id, to_shard_id)
end

#expand(copy_source, involved_in_copy) ⇒ Object



132
133
134
# File 'lib/gizzard/transformation_op.rb', line 132

def expand(copy_source, involved_in_copy)
  { (involved_in_copy ? :cleanup : :prepare) => [self] }
end