Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created June 14, 2012 16:03
Show Gist options
  • Save leejarvis/2931184 to your computer and use it in GitHub Desktop.
Save leejarvis/2931184 to your computer and use it in GitHub Desktop.
a bad example
#!/usr/bin/env ruby
module GroupSend
def group_send(methods, *calls)
items = []
Array(methods).each do |meth|
calls.each { |c| items << self.send(meth).send(c) }
end
items
end
end
class TestString < String
include GroupSend
end
str = TestString.new("foo")
p str.group_send([:reverse, :upcase], :to_sym)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment