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:, title: nil) ⇒ CollapsableSectionPresenter

rubocop:disable Metrics/ParameterLists



6
7
8
9
10
11
12
13
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 6

def initialize(view_context:, text:, id:, icon_class:, open:, title: nil)
  @view_context = view_context
  @text = text
  @id = id
  @icon_class = icon_class
  @open = open
  @title = title
end

Instance Attribute Details

#icon_classObject (readonly)

rubocop:enable Metrics/ParameterLists



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

def icon_class
  @icon_class
end

#idObject (readonly)

rubocop:enable Metrics/ParameterLists



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

def id
  @id
end

#openObject (readonly)

rubocop:enable Metrics/ParameterLists



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

def open
  @open
end

#textObject (readonly)

rubocop:enable Metrics/ParameterLists



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

def text
  @text
end

#titleObject (readonly)

rubocop:enable Metrics/ParameterLists



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

def title
  @title
end

#view_contextObject (readonly)

rubocop:enable Metrics/ParameterLists



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

def view_context
  @view_context
end

Instance Method Details

#render(&block) ⇒ Object



19
20
21
# File 'app/presenters/hyrax/collapsable_section_presenter.rb', line 19

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