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.



4
5
6
7
8
9
10
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 4

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.



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

def icon_class
  @icon_class
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#openObject (readonly)

Returns the value of attribute open.



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

def open
  @open
end

#textObject (readonly)

Returns the value of attribute text.



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

def text
  @text
end

#view_contextObject (readonly)

Returns the value of attribute view_context.



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

def view_context
  @view_context
end

Instance Method Details

#render(&block) ⇒ Object



15
16
17
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 15

def render(&block)
  button_tag + list_tag(&block)
end