Skip to content

Instantly share code, notes, and snippets.

@ricburton
Created January 13, 2013 09:41
Show Gist options
  • Save ricburton/4523278 to your computer and use it in GitHub Desktop.
Save ricburton/4523278 to your computer and use it in GitHub Desktop.
Visibility is not security.
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