Class: Kpop::FrameComponent

Inherits:
ViewComponent::Base
  • Object
show all
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

Instance Method Summary collapse

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

#idObject (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

#inspectObject



32
33
34
# File 'app/components/kpop/frame_component.rb', line 32

def inspect
  "#<#{self.class.name} id: #{id.inspect}>"
end


24
25
26
# File 'app/components/kpop/frame_component.rb', line 24

def modal_flash?
  request.get? && flash.key?(:modal_location)
end


28
29
30
# File 'app/components/kpop/frame_component.rb', line 28

def modal_location
  flash[:modal_location] if modal_flash?
end