Skip to content

Instantly share code, notes, and snippets.

/test.rb Secret

Created December 17, 2012 22:14
Show Gist options
  • Save anonymous/ce25fd66d862f014c5b6 to your computer and use it in GitHub Desktop.
Save anonymous/ce25fd66d862f014c5b6 to your computer and use it in GitHub Desktop.
mark@Marks-MacBook-Air ~$ cat test.rb
class Klass
attr_accessor :business
private :business=
def apps
self.business ||= 1
end
end
puts Klass.new.apps
mark@Marks-MacBook-Air ~$ rbenv global 1.8.7-p370 && rbenv rehash
mark@Marks-MacBook-Air ~$ ruby test.rb
1
mark@Marks-MacBook-Air ~$ rbenv global 1.9.3-p286 && rbenv rehash
mark@Marks-MacBook-Air ~$ ruby test.rb
test.rb:7:in `apps': private method `business=' called for #<Klass:0x007fbbbbed7e88> (NoMethodError)
from test.rb:12:in `<main>'
mark@Marks-MacBook-Air ~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment