Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- method Accumulate
- def accumulate
- self
- end
- end
- class Array
- include Accumulate
- end
- result = %w(hello world).accumulate(&:upcase)
- p result
- # ["hello", "world"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement