Method: Primer::Alpha::SelectPanel::Utils#raise_if_role_given!

Defined in:
app/components/primer/alpha/select_panel.rb

#raise_if_role_given!(**system_arguments) ⇒ Object

[View source]

255
256
257
258
259
260
261
262
263
# File 'app/components/primer/alpha/select_panel.rb', line 255

def raise_if_role_given!(**system_arguments)
  return if shouldnt_raise_error?
  return unless system_arguments.include?(:role)

  raise(
    "Please avoid passing the `role:` argument to `SelectPanel` and its subcomponents. "\
    "The component will automatically apply the correct roles where necessary."
  )
end