Class: PhlexyUI::AvatarGroup

Inherits:
Base
  • Object
show all
Defined in:
lib/phlexy_ui/avatar_group.rb

Instance Method Summary collapse

Constructor Details

#initialize(as: :div) ⇒ AvatarGroup

Returns a new instance of AvatarGroup.



5
6
7
8
# File 'lib/phlexy_ui/avatar_group.rb', line 5

def initialize(*, as: :div, **)
  super(*, **)
  @as = as
end

Instance Method Details

#avatarObject



19
20
21
# File 'lib/phlexy_ui/avatar_group.rb', line 19

def avatar(*, **, &)
  render PhlexyUI::Avatar.new(*, **, &)
end

#view_templateObject



10
11
12
13
14
15
16
17
# File 'lib/phlexy_ui/avatar_group.rb', line 10

def view_template(&)
  generate_classes!(
    component_html_class: :"avatar-group",
    options:
  ).then do |classes|
    public_send(as, class: classes, **options, &)
  end
end