Class: PhlexUI::Clipboard

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex_ui/clipboard.rb

Defined Under Namespace

Classes: Popover, Source, Trigger

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#before_template

Constructor Details

#initialize(success: "Copied!", error: "Copy Failed!", **attrs) ⇒ Clipboard

Returns a new instance of Clipboard.



5
6
7
8
9
# File 'lib/phlex_ui/clipboard.rb', line 5

def initialize(success: "Copied!", error: "Copy Failed!", **attrs)
  @success = success
  @error = error
  super(**attrs)
end

Instance Method Details

#view_template(&block) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/phlex_ui/clipboard.rb', line 11

def view_template(&block)
  div(**attrs) do
    div(&block)
    success_popover
    error_popover
  end
end