Class: UI::DrawerClose

Inherits:
Phlex::HTML
  • Object
show all
Includes:
DrawerCloseBehavior
Defined in:
app/components/ui/drawer_close.rb

Instance Method Summary collapse

Methods included from DrawerCloseBehavior

#drawer_close_data_attributes

Constructor Details

#initialize(variant: :outline, size: :default, classes: nil, **attributes) ⇒ DrawerClose

Returns a new instance of DrawerClose.



6
7
8
9
10
11
# File 'app/components/ui/drawer_close.rb', line 6

def initialize(variant: :outline, size: :default, classes: nil, **attributes)
  @variant = variant
  @size = size
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template(&block) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'app/components/ui/drawer_close.rb', line 13

def view_template(&block)
  render UI::Button.new(
    variant: @variant,
    size: @size,
    classes: @classes,
    **drawer_close_data_attributes.merge(@attributes)
  ) do
    yield if block_given?
  end
end