Created
January 13, 2013 09:41
-
-
Save ricburton/4523278 to your computer and use it in GitHub Desktop.
Visibility is not security.
This file contains hidden or 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
class Test | |
attr_reader :state | |
def initialize(state) | |
@state = state | |
end | |
private | |
def update_state(state) | |
@state = state | |
end | |
end | |
t = Test.new(:before) | |
# This will raise an exception | |
t.update_state(:after) | |
# This will not | |
t.send(:update_state, :after) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment