Class: Gizzard::Transformation::Op::BaseOp

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

Direct Known Subclasses

CopyShard, DiffShards, LinkOp, RepairShards, ShardOp

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



20
21
22
# File 'lib/gizzard/transformation_op.rb', line 20

def <=>(other)
  Transformation::OP_PRIORITIES[self.class] <=> Transformation::OP_PRIORITIES[other.class]
end

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


8
9
10
# File 'lib/gizzard/transformation_op.rb', line 8

def eql?(other)
  self.class == other.class
end

#inspectObject



14
15
16
17
18
# File 'lib/gizzard/transformation_op.rb', line 14

def inspect
  templates = (is_a?(LinkOp) ? [from, to] : [*template]).map {|t| t.identifier }.join(" -> ")
  name      = Transformation::OP_NAMES[self.class]
  "#{name}(#{templates})"
end

#inverse?(other) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/gizzard/transformation_op.rb', line 4

def inverse?(other)
  Transformation::OP_INVERSES[self.class] == other.class
end

#involved_shards(table_prefix, translations) ⇒ Object



24
25
26
# File 'lib/gizzard/transformation_op.rb', line 24

def involved_shards(table_prefix, translations)
  []
end