Class: Yattho::Forms::Dsl::ButtonInput

Inherits:
Input
  • Object
show all
Defined in:
lib/yattho/forms/dsl/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

#builder, #caption, #form, #form_control, #ids, #input_arguments, #label_arguments, #validation_message

Instance Method Summary collapse

Methods inherited from Input

#add_input_aria, #add_input_classes, #add_input_data, #add_label_classes, #autofocus!, #caption?, #caption_id, #caption_template?, #disabled?, #focusable?, #full_width?, #hidden?, #input?, #invalid?, #merge_input_arguments!, #need_validation_element?, #remove_input_data, #render_caption_template, #required?, #size, #valid?, #validation_arguments, #validation_id, #validation_message_arguments, #validation_messages

Methods included from ClassNameHelper

#class_names

Constructor Details

#initialize(name:, label:, **system_arguments, &block) ⇒ ButtonInput

Returns a new instance of ButtonInput.



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

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

  super(**system_arguments)
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



8
9
10
# File 'lib/yattho/forms/dsl/button_input.rb', line 8

def block
  @block
end

#labelObject (readonly)

Returns the value of attribute label.



8
9
10
# File 'lib/yattho/forms/dsl/button_input.rb', line 8

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/yattho/forms/dsl/button_input.rb', line 8

def name
  @name
end

Instance Method Details

#to_componentObject



18
19
20
# File 'lib/yattho/forms/dsl/button_input.rb', line 18

def to_component
  Button.new(input: self)
end

#typeObject

:nocov:



23
24
25
# File 'lib/yattho/forms/dsl/button_input.rb', line 23

def type
  :button
end