Class: Ariadne::Forms::Dsl::ClipboardCopyButton

Inherits:
Object
  • Object
show all
Includes:
InputMethods
Defined in:
lib/ariadne/forms/dsl/clipboard_copy_button.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InputMethods

#action_menu, #auto_complete, #button, #check_box, #check_box_group, #clipboard_copy_button, #fields_for, #hidden, #inputs, #multi, #radio_button_group, #select_list, #separator, #status, #submit, #text_area, #text_field

Constructor Details

#initialize(builder:, form:, **options) {|_self| ... } ⇒ ClipboardCopyButton

Returns a new instance of ClipboardCopyButton.

Yields:

  • (_self)

Yield Parameters:



12
13
14
15
16
17
18
# File 'lib/ariadne/forms/dsl/clipboard_copy_button.rb', line 12

def initialize(builder:, form:, **options)
  @builder = builder
  @form = form
  @options = options

  yield(self) if block_given?
end

Instance Attribute Details

#builderObject (readonly)

Returns the value of attribute builder.



10
11
12
# File 'lib/ariadne/forms/dsl/clipboard_copy_button.rb', line 10

def builder
  @builder
end

#formObject (readonly)

Returns the value of attribute form.



10
11
12
# File 'lib/ariadne/forms/dsl/clipboard_copy_button.rb', line 10

def form
  @form
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/ariadne/forms/dsl/clipboard_copy_button.rb', line 10

def options
  @options
end

#textObject (readonly)

Returns the value of attribute text.



10
11
12
# File 'lib/ariadne/forms/dsl/clipboard_copy_button.rb', line 10

def text
  @text
end

Instance Method Details

#input?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/ariadne/forms/dsl/clipboard_copy_button.rb', line 28

def input?
  false
end

#to_componentObject



20
21
22
# File 'lib/ariadne/forms/dsl/clipboard_copy_button.rb', line 20

def to_component
  Ariadne::UI::ClipboardCopy::Component.new(text: @text, **@options)
end

#typeObject



24
25
26
# File 'lib/ariadne/forms/dsl/clipboard_copy_button.rb', line 24

def type
  :clipboard_copy
end