Skip to content

Instantly share code, notes, and snippets.

@kkchu791
Created November 13, 2015 00:50
Show Gist options
  • Save kkchu791/b4e0a00f0beda7e4284f to your computer and use it in GitHub Desktop.
Save kkchu791/b4e0a00f0beda7e4284f to your computer and use it in GitHub Desktop.
#Write a class called Person that has balance as an instance variable and make it readable via an accessor.
class Person
attr_reader :balance
def initialize
@balance = 400
end
end
Tom = Person.new
p Tom.balance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment