Skip to content

Instantly share code, notes, and snippets.

@hannesfostie
Created November 20, 2015 14:30
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 hannesfostie/3719110d7d6142c0648d to your computer and use it in GitHub Desktop.
Save hannesfostie/3719110d7d6142c0648d to your computer and use it in GitHub Desktop.
irb(main):005:0> class Foo
irb(main):006:1> attr_accessor :bar
irb(main):007:1> end
=> nil
irb(main):008:0> foo = Foo.new
=> #<Foo:0x007fc4593f9b78>
irb(main):009:0> foo.bar = "hello"
=> "hello"
irb(main):016:0> @test = foo.bar
=> "hello"
irb(main):017:0> @test.gsub! /llo/, 'lp'
=> "help"
irb(main):018:0> foo.bar
=> "help"
irb(main):019:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment