Created
November 8, 2010 22:22
-
-
Save joesavak/668381 to your computer and use it in GitHub Desktop.
Ruby quick getter setter
This file contains 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 Product | |
attr_accessor :external_id #automagically create reader & writer methods | |
attr_reader :internal_id #automagically create reader method | |
attr_writer :product_id #automagically create writer method | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment