Skip to content

Instantly share code, notes, and snippets.

@jimweirich
Created January 4, 2010 05:50
Show Gist options
  • Save jimweirich/268334 to your computer and use it in GitHub Desktop.
Save jimweirich/268334 to your computer and use it in GitHub Desktop.
class FL
def initialize(array)
@ary = array
end
def ==(array)
to_ary == array
end
def to_ary
@ary
end
end
# This is true in both MRI and JRuby:
p(['a'] == FL.new(['a']))
# Oddly, this is true only in MRI, it is false in JRuby
p([['a']] == [FL.new(['a'])])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment