Class: Kpop::ModalComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Kpop::ModalComponent
- Includes:
- Katalyst::HtmlAttributes
- Defined in:
- app/components/kpop/modal_component.rb
Instance Method Summary collapse
-
#initialize(title:, fallback_location: nil, layout: nil, captive: false, **html_attributes) ⇒ ModalComponent
constructor
A new instance of ModalComponent.
- #inspect ⇒ Object
- #with_footer_buttons ⇒ Object
Constructor Details
#initialize(title:, fallback_location: nil, layout: nil, captive: false, **html_attributes) ⇒ ModalComponent
Returns a new instance of ModalComponent.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/components/kpop/modal_component.rb', line 13 def initialize(title:, fallback_location: nil, layout: nil, captive: false, **html_attributes) self.content_attributes = html_attributes.delete(:content) if html_attributes.key?(:content) super(**html_attributes) @fallback_location = fallback_location @layout = layout # Generate a title bar. This can be overridden by calling title_bar again. with_title(title:, captive:) if title.present? end |
Instance Method Details
#inspect ⇒ Object
29 30 31 |
# File 'app/components/kpop/modal_component.rb', line 29 def inspect "#<#{self.class.name} title: #{title.inspect}>" end |
#with_footer_buttons ⇒ Object
25 26 27 |
# File 'app/components/kpop/modal_component.rb', line 25 def (**, &) (class: "button-set", **, &) end |