Class: Kpop::FrameComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Kpop::FrameComponent
- Includes:
- Katalyst::HtmlAttributes, Turbo::FramesHelper
- Defined in:
- app/components/kpop/frame_component.rb
Constant Summary collapse
- ACTIONS =
%w[ turbo:before-fetch-request@window->kpop--frame#beforeFetchRequest turbo:before-frame-render->kpop--frame#beforeFrameRender turbo:before-stream-render@window->kpop--frame#beforeStreamRender turbo:before-visit@window->kpop--frame#beforeVisit turbo:frame-load->kpop--frame#frameLoad ].freeze
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id: "kpop") ⇒ FrameComponent
constructor
A new instance of FrameComponent.
- #inspect ⇒ Object
- #modal_flash? ⇒ Boolean
- #modal_location ⇒ Object
Constructor Details
#initialize(id: "kpop") ⇒ FrameComponent
18 19 20 21 22 |
# File 'app/components/kpop/frame_component.rb', line 18 def initialize(id: "kpop", **) super(**) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'app/components/kpop/frame_component.rb', line 8 def id @id end |
Instance Method Details
#inspect ⇒ Object
32 33 34 |
# File 'app/components/kpop/frame_component.rb', line 32 def inspect "#<#{self.class.name} id: #{id.inspect}>" end |
#modal_flash? ⇒ Boolean
24 25 26 |
# File 'app/components/kpop/frame_component.rb', line 24 def modal_flash? request.get? && flash.key?(:modal_location) end |
#modal_location ⇒ Object
28 29 30 |
# File 'app/components/kpop/frame_component.rb', line 28 def modal_location flash[:modal_location] if modal_flash? end |