Class: PhlexKit::BubbleReactions

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/bubble/bubble_reactions.rb

Constant Summary collapse

SIDES =
%i[top bottom].freeze
ALIGNS =
%i[start end].freeze

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(side: :bottom, align: :end, **attrs) ⇒ BubbleReactions

Returns a new instance of BubbleReactions.

Raises:

  • (KeyError)


5
6
7
8
9
10
11
# File 'app/components/phlex_kit/bubble/bubble_reactions.rb', line 5

def initialize(side: :bottom, align: :end, **attrs)
  @side = side.to_sym
  raise KeyError, "unknown BubbleReactions side #{@side}" unless SIDES.include?(@side)
  @align = align.to_sym
  raise KeyError, "unknown BubbleReactions align #{@align}" unless ALIGNS.include?(@align)
  @attrs = attrs
end

Instance Method Details

#view_templateObject



12
13
14
# File 'app/components/phlex_kit/bubble/bubble_reactions.rb', line 12

def view_template(&)
  div(**mix({ class: "pk-bubble-reactions", data: { slot: "bubble-reactions", side: @side, align: @align } }, @attrs), &)
end