SHARE
TWEET

Untitled

a guest Jun 24th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # File: protected-example-4.rb
  2. #
  3. class MyClass
  4.   def public_foo
  5.     puts 'public foo'
  6.   end
  7.  
  8.   protected
  9.  
  10.   def protected_foo
  11.     puts 'protected_foo'
  12.   end
  13. end
  14.  
  15. a = MyClass.new
  16. a.public_foo
  17. a.protected_foo
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top