Class: Protos::Drawer

Inherits:
Component
  • Object
show all
Defined in:
lib/protos/drawer.rb,
lib/protos/drawer/side.rb,
lib/protos/drawer/content.rb,
lib/protos/drawer/trigger.rb

Defined Under Namespace

Classes: Content, Side, Trigger

Instance Method Summary collapse

Methods inherited from Component

#initialize

Constructor Details

This class inherits a constructor from Protos::Component

Instance Method Details

#contentObject



28
# File 'lib/protos/drawer.rb', line 28

def content(...) = render Content.new(...)

#sideObject



30
# File 'lib/protos/drawer.rb', line 30

def side(*, **, &) = render Side.new(*, input_id: @id, **, &)

#triggerObject



32
# File 'lib/protos/drawer.rb', line 32

def trigger(*, **, &) = render Trigger.new(*, input_id: @id, **, &)

#view_templateObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/protos/drawer.rb', line 15

def view_template
  div(**attrs) do
    input(
      id: @id,
      type: :checkbox,
      class: css[:toggle],
      autocomplete: :off,
      form: ""
    )
    yield if block_given?
  end
end