Skip to content

Instantly share code, notes, and snippets.

@lolmaus
Created May 15, 2012 14:25
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 lolmaus/2702153 to your computer and use it in GitHub Desktop.
Save lolmaus/2702153 to your computer and use it in GitHub Desktop.
class MyClass
attr_reader :the_string # i don't want to grant write access!
def initialize(string)
@the_string = string
end
end
vasya = MyClass.new("Test")
puts vasya.the_string # Test
vasya.the_string.reverse!
puts vasya.the_string # tseT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment