Class: Ariadne::Forms::Dsl::SubmitButtonInput

Inherits:
Input
  • Object
show all
Defined in:
lib/ariadne/forms/dsl/submit_button_input.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Input

Input::DEFAULT_SIZE, Input::SIZE_MAPPINGS, Input::SIZE_OPTIONS, Input::SPACE_DELIMITED_ARIA_ATTRIBUTES

Instance Attribute Summary collapse

Attributes inherited from Input

#base_id, #builder, #caption, #form, #form_control, #ids, #input_attributes, #label_attributes, #validation_message

Instance Method Summary collapse

Methods inherited from Input

#add_input_aria, #add_input_classes, #add_input_data, #autofocus!, #caption?, #caption_id, #caption_template?, #disabled?, #focusable?, #hidden?, #id, #input?, #invalid?, #merge_input_attributes!, #remove_input_data, #render_caption_template, #required?, #size, #valid?, #validation_arguments, #validation_error_icon_target, #validation_id, #validation_message_arguments, #validation_messages, #validation_success_icon_target

Methods included from ClassNameHelper

#merge_class_names

Constructor Details

#initialize(name:, label:, **options, &block) ⇒ SubmitButtonInput

Returns a new instance of SubmitButtonInput.



10
11
12
13
14
15
16
# File 'lib/ariadne/forms/dsl/submit_button_input.rb', line 10

def initialize(name:, label:, **options, &block)
  @name = name
  @label = label
  @block = block

  super(**options)
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



8
9
10
# File 'lib/ariadne/forms/dsl/submit_button_input.rb', line 8

def block
  @block
end

#labelObject (readonly)

Returns the value of attribute label.



8
9
10
# File 'lib/ariadne/forms/dsl/submit_button_input.rb', line 8

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/ariadne/forms/dsl/submit_button_input.rb', line 8

def name
  @name
end

Instance Method Details

#supports_validation?Boolean

Returns:

  • (Boolean)


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

def supports_validation?
  false
end

#to_componentObject



18
19
20
21
# File 'lib/ariadne/forms/dsl/submit_button_input.rb', line 18

def to_component
  html_attrs = @input_attributes || {}
  Ariadne::UI::Button::Component.new(type: :submit, **@options, html_attrs: html_attrs).with_content(@label)
end

#typeObject

:nocov:



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

def type
  :submit_button
end