Skip to content

Instantly share code, notes, and snippets.

@joesavak
Created November 8, 2010 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joesavak/668381 to your computer and use it in GitHub Desktop.
Save joesavak/668381 to your computer and use it in GitHub Desktop.
Ruby quick getter setter
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