Class: UI::Sheet

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

Instance Method Summary collapse

Methods included from SheetBehavior

#merged_sheet_data_attributes, #sheet_base_classes, #sheet_classes, #sheet_data_attributes, #sheet_html_attributes

Constructor Details

#initialize(open: false, close_on_escape: true, close_on_overlay_click: true, classes: nil, **attributes) ⇒ Sheet

Returns a new instance of Sheet.



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

def initialize(open: false, close_on_escape: true, close_on_overlay_click: true, classes: nil, **attributes)
  @open = open
  @close_on_escape = close_on_escape
  @close_on_overlay_click = close_on_overlay_click
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template(&block) ⇒ Object



14
15
16
17
18
# File 'app/components/ui/sheet.rb', line 14

def view_template(&block)
  div(**sheet_html_attributes) do
    yield if block_given?
  end
end