daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Dec 16th, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class PlayerList
  2.  
  3.   include Enumerable
  4.  
  5.   def initialize(list_of_players)
  6.     @data = list_of_players
  7.   end
  8.  
  9.   def each
  10.     @data.each { |e| yield(e) }
  11.   end
  12.  
  13. end
  14.  
  15. player_list = PlayerList.new(["greg", "jia", "shane"])
  16. player_list.each { |player| puts player }
  17. p player_list.map { |player| player.reverse }
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