Created
August 3, 2016 15:20
-
-
Save hackervera/5608b396835e569bcef8c4e2197bfb22 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
2.1.2 :001 > Person = Struct.new(:name, :age, :location) do | |
2.1.2 :002 > def timezone | |
2.1.2 :003?> "Person currently in whatever timezone contains #{location}" | |
2.1.2 :004?> end | |
2.1.2 :005?> end | |
=> Person | |
2.1.2 :006 > tyler = Person.new(:tyler, 32, :portland) | |
=> #<struct Person name=:tyler, age=32, location=:portland> | |
2.1.2 :007 > tyler.location | |
=> :portland | |
2.1.2 :008 > tyler.timezone | |
=> "Person currently in whatever timezone contains portland" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment