Skip to content

Instantly share code, notes, and snippets.

@kenichi
Created July 14, 2017 22:08
Show Gist options
  • Save kenichi/7ab9c19f4cdca0cd80e1e361d9a93c9f to your computer and use it in GitHub Desktop.
Save kenichi/7ab9c19f4cdca0cd80e1e361d9a93c9f to your computer and use it in GitHub Desktop.
def bam(*a, baz:, bat:, **h, &block)
[*a, block.parameters, baz: baz, bat: bat, **h]
end
__END__
> bam 1, 2, 'a', 'b' => 'c', d: 0xe, baz: 'mno', bat: 'jkl' do |*ar, foo:, **hash|; end
=> [1, 2, "a", {"b"=>"c"}, [[:rest, :ar], [:keyreq, :foo], [:keyrest, :hash]], {:baz=>"mno", :bat=>"jkl", :d=>14}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment