Class: Charming::Presentation::Components::Modal

Inherits:
Charming::Presentation::Component show all
Defined in:
lib/charming/presentation/components/modal.rb

Instance Method Summary collapse

Methods inherited from View

#focused?, #layout_assigns

Constructor Details

#initialize(content:, title: nil, help: nil, width: 52, style: nil, theme: nil) ⇒ Modal

Returns a new instance of Modal.



7
8
9
10
11
12
13
14
# File 'lib/charming/presentation/components/modal.rb', line 7

def initialize(content:, title: nil, help: nil, width: 52, style: nil, theme: nil)
  super(theme: theme)
  @content = content
  @title = title
  @help = help
  @width = width
  @style = style
end

Instance Method Details

#renderObject



16
17
18
# File 'lib/charming/presentation/components/modal.rb', line 16

def render
  box(column(*lines, gap: 1), style: modal_style)
end