Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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