Created
June 17, 2017 16:46
-
-
Save mariorcardoso/56a7201188dcaceef5592e39b694dcb3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Address | |
attr_reader :city, :state | |
def initialize(city, state) | |
@city, @state = city, state | |
end | |
def ==(other_address) | |
city == other_address.city && state == other_address.state | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
based on http://www.informit.com/articles/article.aspx?p=2220311&seqNum=11