Method: Primer::Beta::Details#initialize

Defined in:
app/components/primer/beta/details.rb

#initialize(overlay: NO_OVERLAY, reset: false, disabled: false, **system_arguments) ⇒ Details

Returns a new instance of Details.

Parameters:

  • overlay (Symbol) (defaults to: NO_OVERLAY)

    Dictates the type of overlay to render with. <%= one_of(Primer::Beta::Details::OVERLAY_MAPPINGS.keys) %>

  • reset (Boolean) (defaults to: false)

    Defaults to false. If set to true, it will remove the default caret and remove style from the summary element

  • disabled (Boolean) (defaults to: false)

    Whether or not to disable the summary button.

  • system_arguments (Hash)

    <%= link_to_system_arguments_docs %>

[View source]

52
53
54
55
56
57
58
59
60
61
62
# File 'app/components/primer/beta/details.rb', line 52

def initialize(overlay: NO_OVERLAY, reset: false, disabled: false, **system_arguments)
  @system_arguments = deny_tag_argument(**system_arguments)
  @system_arguments[:tag] = :details
  @system_arguments[:classes] = class_names(
    system_arguments[:classes],
    OVERLAY_MAPPINGS[fetch_or_fallback(OVERLAY_MAPPINGS.keys, overlay, NO_OVERLAY)],
    "details-reset" => reset
  )
  @disabled = disabled
  @summary_info = nil
end