Class: Koi::Header::IndexComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Koi::Header::IndexComponent
- Defined in:
- app/components/koi/header/index_component.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(model:, title: model.model_name.human.pluralize) ⇒ IndexComponent
constructor
A new instance of IndexComponent.
Constructor Details
#initialize(model:, title: model.model_name.human.pluralize) ⇒ IndexComponent
Returns a new instance of IndexComponent.
10 11 12 13 14 15 16 |
# File 'app/components/koi/header/index_component.rb', line 10 def initialize(model:, title: model.model_name.human.pluralize) super @header = HeaderComponent.new(title:) @model = model @title = title end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
6 7 8 |
# File 'app/components/koi/header/index_component.rb', line 6 def model @model end |
Instance Method Details
#call ⇒ Object
18 19 20 |
# File 'app/components/koi/header/index_component.rb', line 18 def call render @header.with_content(content || "") end |