-
-
Save anonymous/ce25fd66d862f014c5b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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