Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
> class Foo def initialize @foo = "foo" end def foo @foo end end # => nil > foo = Foo.new # => #<Foo:0x22e20dc @foo="foo"> > foo.foo # => "foo" > foo.foo = "bar" NoMethodError: undefined method `foo=' for #<Foo:0x22e20dc @foo="foo"> from (irb):33 > class Bar def initialize @bar = "bar" end def bar=(value) @bar = value end end # => nil > bar = Bar.new # => #<Bar:0x22ce3ac @bar="bar"> > bar.bar = "foo" # => "foo" > bar.bar NoMethodError: undefined method `bar' for #<Bar:0x22ce3ac @bar="bar"> from (irb):43 > bar.instance_variable_get("@bar") # => "foo"
This paste will be private.
From the Design Piracy series on my blog: