Skip to content

Instantly share code, notes, and snippets.

@jredville
Created January 31, 2014 21:47
Show Gist options
  • Save jredville/8743940 to your computer and use it in GitHub Desktop.
Save jredville/8743940 to your computer and use it in GitHub Desktop.
class Foo
attr_accessor :foo, :bar
def initialize(foo, bar)
@foo = foo
@bar = bar
end
def ==(other)
self.class == other.class &&
foo == other.foo &&
bar == other.bar
end
end
#pretty much identical
class Foo < Struct.new(:foo, :bar)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment