# Implements the conventional constructor with "hash of attributes" and block support
module Tracksperanto::BlockInit
  def initialize(**object_attribute_hash)
    object_attribute_hash.map { |(k, v)| public_send("#{k}=", v) }
    yield(self) if block_given?
  end
end

# Implements the conventional constructor with "hash of attributes" and block support
module Tracksperanto::BlockInit
  def initialize(attributes = {})
    attributes.map { |(k, v)| public_send("#{k}=", v) }
    yield(self) if block_given?
  end
end

Switch back to attributes for BlockInit
Switch back to attributes for BlockInit

as the kwargs version would cause issues with Ruby 3
