Method: Primer::Beta::AvatarStack#initialize
- Defined in:
- app/components/primer/beta/avatar_stack.rb
permalink #initialize(tag: DEFAULT_TAG, align: ALIGN_DEFAULT, tooltipped: false, body_arguments: {}, **system_arguments) ⇒ AvatarStack
Returns a new instance of AvatarStack.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/components/primer/beta/avatar_stack.rb', line 29 def initialize(tag: DEFAULT_TAG, align: ALIGN_DEFAULT, tooltipped: false, body_arguments: {}, **system_arguments) @align = fetch_or_fallback(ALIGN_OPTIONS, align, ALIGN_DEFAULT) @system_arguments = system_arguments @tooltipped = tooltipped @body_arguments = body_arguments body_tag = @body_arguments[:tag] || DEFAULT_BODY_TAG @body_arguments[:tag] = fetch_or_fallback(BODY_TAG_OPTIONS, body_tag, DEFAULT_BODY_TAG) @body_arguments[:classes] = class_names( "AvatarStack-body", @body_arguments[:classes] ) @system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG) @system_arguments[:classes] = class_names( "AvatarStack", system_arguments[:classes], "AvatarStack--right" => @align == :right ) end |