Method: Sequitur::Production#==

Defined in:
lib/sequitur/production.rb

#==(other) ⇒ Object

Identity testing.

Parameters:

  • other

    [] another production or production reference.

Returns:

  • true when the receiver and other are the same.



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/sequitur/production.rb', line 37

def ==(other)
  return true if object_id == other.object_id

  result = if other.is_a?(ProductionRef)
             (other == self)
           else
             false
           end

  return result
end