What does double splat (**) argument mean in this code example and why use it?

Viewed 472

So I've been over Traiblazer and Reform documentation and I often see this kind of code

class AlbumForm < Reform::Form
  collection :songs, populate_if_empty: :populate_songs! do
    property :name
  end

  def populate_songs!(fragment:, **)
    Song.find_by(name: fragment["name"]) or Song.new
  end
end

Notice the def populate_songs!(fragment:, **) definition?

I'm well aware of double splat named arguments (like **others) that capture all other keyword arguments. But I've never seen ** alone, without a name.

So my 2 questions are:

  1. what does ** mean in the block above?
  2. why use this syntax?
1 Answers
Related