Class: Hyrax::CollapsableSectionPresenter

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

Instance Method Summary collapse

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_classObject (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

#idObject (readonly)

Returns the value of attribute id.



13
14
15
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 13

def id
  @id
end

#openObject (readonly)

Returns the value of attribute open.



13
14
15
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 13

def open
  @open
end

#textObject (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_contextObject (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)
  button_tag + list_tag(&block)
end