Skip to content

Instantly share code, notes, and snippets.

@fronx
Created September 1, 2011 11:10
Show Gist options
  • Select an option

  • Save fronx/1185961 to your computer and use it in GitHub Desktop.

Select an option

Save fronx/1185961 to your computer and use it in GitHub Desktop.
class Object
def out; tap { |x| puts x.inspect } end
ends
def S(*args)
f = args.shift.to_proc
args.instance_eval(&f)
end
S(:join, :a, :b, :c).out # => "abc"
S(:max, 1, 5, 3).out # => 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment