Class: UI::InputOtpSlotComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::InputOtpSlotComponent
- Includes:
- InputOtpSlotBehavior
- Defined in:
- app/view_components/ui/input_otp_slot_component.rb
Overview
SlotComponent - ViewComponent implementation
Individual OTP input slot for a single character.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(index: 0, value: "", name: nil, id: nil, disabled: false, classes: "", **attributes) ⇒ InputOtpSlotComponent
constructor
A new instance of InputOtpSlotComponent.
Methods included from InputOtpSlotBehavior
#input_otp_slot_classes, #input_otp_slot_data_attributes, #input_otp_slot_html_attributes
Constructor Details
#initialize(index: 0, value: "", name: nil, id: nil, disabled: false, classes: "", **attributes) ⇒ InputOtpSlotComponent
Returns a new instance of InputOtpSlotComponent.
19 20 21 22 23 24 25 26 27 |
# File 'app/view_components/ui/input_otp_slot_component.rb', line 19 def initialize(index: 0, value: "", name: nil, id: nil, disabled: false, classes: "", **attributes) @index = index @value = value @name = name @id = id @disabled = disabled @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
29 30 31 |
# File 'app/view_components/ui/input_otp_slot_component.rb', line 29 def call tag.input(**input_otp_slot_html_attributes.merge(@attributes)) end |