Class: Kpop::Modal::TitleComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
Katalyst::HtmlAttributes
Defined in:
app/components/kpop/modal/title_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(title: nil, captive: false) ⇒ TitleComponent

Returns a new instance of TitleComponent.



8
9
10
11
12
13
# File 'app/components/kpop/modal/title_component.rb', line 8

def initialize(title: nil, captive: false, **)
  super

  @title = title
  @captive = captive
end

Instance Method Details

#captive?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/components/kpop/modal/title_component.rb', line 19

def captive?
  @captive
end

#inspectObject



23
24
25
# File 'app/components/kpop/modal/title_component.rb', line 23

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

#titleObject



15
16
17
# File 'app/components/kpop/modal/title_component.rb', line 15

def title
  content? ? content : @title
end