daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class A
  2.   def self.[]
  3.     # some_argument
  4.   end
  5. end
  6.    
  7. class A
  8.   def self.[](arg)
  9.     puts arg
  10.   end  
  11. end  
  12.  
  13. A[1]
  14. # => 1
  15.    
  16. class A
  17.   def self.[](*args)
  18.     puts args
  19.   end
  20. end
  21.  
  22. > A[1,2,3]
  23.    1
  24.    2
  25.    3
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