Class: Protos::Swap
- Inherits:
-
Component
show all
- Defined in:
- lib/protos/swap.rb,
lib/protos/swap/on.rb,
lib/protos/swap/off.rb
Defined Under Namespace
Classes: Off, On
Instance Method Summary
collapse
Methods inherited from Component
#initialize
Instance Method Details
#off ⇒ Object
27
|
# File 'lib/protos/swap.rb', line 27
def off(...) = render Off.new(...)
|
#on ⇒ Object
25
|
# File 'lib/protos/swap.rb', line 25
def on(...) = render On.new(...)
|
#view_template ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/protos/swap.rb', line 12
def view_template
label(**attrs) do
input(
type: :checkbox,
class: css[:input],
autocomplete: :off,
form: "",
aria_label: "swap"
)
yield if block_given?
end
end
|