Class: Gizzard::Transformation::Op::LinkOp

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

Direct Known Subclasses

AddLink, RemoveLink

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseOp

#<=>, #inspect, #involved_shards

Constructor Details

#initialize(from, to, wrapper_type = nil) ⇒ LinkOp

Returns a new instance of LinkOp.



97
98
99
100
101
# File 'lib/gizzard/transformation_op.rb', line 97

def initialize(from, to, wrapper_type=nil)
  @from = from
  @to   = to
  @wrapper_type = wrapper_type
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



94
95
96
# File 'lib/gizzard/transformation_op.rb', line 94

def from
  @from
end

#toObject (readonly) Also known as: template

Returns the value of attribute to.



94
95
96
# File 'lib/gizzard/transformation_op.rb', line 94

def to
  @to
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


107
108
109
# File 'lib/gizzard/transformation_op.rb', line 107

def eql?(other)
  super && self.from.link_eql?(other.from) && self.to.link_eql?(other.to)
end

#inverse?(other) ⇒ Boolean

Returns:

  • (Boolean)


103
104
105
# File 'lib/gizzard/transformation_op.rb', line 103

def inverse?(other)
  super && self.from.link_eql?(other.from) && self.to.link_eql?(other.to)
end