Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created September 14, 2011 04:16
Show Gist options
  • Save mwotton/1215839 to your computer and use it in GitHub Desktop.
Save mwotton/1215839 to your computer and use it in GitHub Desktop.
def magic()
raise "not defined"
end
def foobar(bar, baz)
"#{bar} is definitely not a #{baz}"
end
def quux(bar, baz, bahooey)
"Whereas #{bar} and #{baz} might be #{bahooey}"
end
strings = %w{some samples}
strings.map(&magic(foobar("first"))).should ==
["first is definitely not a some", "first is definitely not a samples"]
strings.map(&magic(quux("first", "second"))).should ==
["Whereas first and second might me some",
"Whereas first and second might me samples"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment