Class: Hyrax::CollapsableSectionPresenter
- Inherits:
-
Object
- Object
- Hyrax::CollapsableSectionPresenter
- Defined in:
- app/presenters/hyrax/collapsable_section_presenter.rb
Overview
Draws a collapsable list widget using the Bootstrap 3 / Collapse.js plugin
Instance Attribute Summary collapse
-
#icon_class ⇒ Object
readonly
Returns the value of attribute icon_class.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#open ⇒ Object
readonly
Returns the value of attribute open.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#view_context ⇒ Object
readonly
Returns the value of attribute view_context.
Instance Method Summary collapse
-
#initialize(view_context:, text:, id:, icon_class:, open:) ⇒ CollapsableSectionPresenter
constructor
A new instance of CollapsableSectionPresenter.
- #render(&block) ⇒ Object
Constructor Details
#initialize(view_context:, text:, id:, icon_class:, open:) ⇒ CollapsableSectionPresenter
Returns a new instance of CollapsableSectionPresenter.
5 6 7 8 9 10 11 |
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 5 def initialize(view_context:, text:, id:, icon_class:, open:) @view_context = view_context @text = text @id = id @icon_class = icon_class @open = open end |
Instance Attribute Details
#icon_class ⇒ Object (readonly)
Returns the value of attribute icon_class.
13 14 15 |
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 13 def icon_class @icon_class end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
13 14 15 |
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 13 def id @id end |
#open ⇒ Object (readonly)
Returns the value of attribute open.
13 14 15 |
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 13 def open @open end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
13 14 15 |
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 13 def text @text end |
#view_context ⇒ Object (readonly)
Returns the value of attribute view_context.
13 14 15 |
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 13 def view_context @view_context end |
Instance Method Details
#render(&block) ⇒ Object
16 17 18 |
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 16 def render(&block) + list_tag(&block) end |