Class: SdrViewComponents::Elements::ModalComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/sdr_view_components/elements/modal_component.rb

Overview

Renders a modal dialog

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseComponent

#args_for, #merge_actions, #merge_classes

Constructor Details

#initialize(id:, size: :lg) ⇒ ModalComponent

Returns a new instance of ModalComponent.



11
12
13
14
15
# File 'app/components/sdr_view_components/elements/modal_component.rb', line 11

def initialize(id:, size: :lg)
  @id = id
  @size = size
  super()
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



17
18
19
# File 'app/components/sdr_view_components/elements/modal_component.rb', line 17

def id
  @id
end

Instance Method Details

#classesObject



19
20
21
# File 'app/components/sdr_view_components/elements/modal_component.rb', line 19

def classes
  merge_classes('modal', @size ? "modal-#{@size}" : nil)
end