Class: SdrViewComponents::Elements::ModalComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- SdrViewComponents::Elements::ModalComponent
- Defined in:
- app/components/sdr_view_components/elements/modal_component.rb
Overview
Renders a modal dialog
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #classes ⇒ Object
-
#initialize(id:, size: :lg) ⇒ ModalComponent
constructor
A new instance of ModalComponent.
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
#id ⇒ Object (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
#classes ⇒ Object
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 |