Class: Willamette::Strategies::Sidebar
- Inherits:
-
Object
- Object
- Willamette::Strategies::Sidebar
- Defined in:
- lib/willamette/strategies/sidebar.rb
Overview
Contain logic for rendering rubocop:disable Metrics/ParameterLists
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Instance Method Summary collapse
- #default_link_icon(folder: false) ⇒ Object
- #description? ⇒ Boolean
- #explore? ⇒ Boolean
- #explore_links ⇒ Object
- #follow? ⇒ Boolean
- #follow_links ⇒ Object
-
#initialize(component, description:, explore_links:, follow_links:, subscribe:, see_also_links:) ⇒ Sidebar
constructor
Use the ‘sidebar` module method on `Willamette`.
- #see_also? ⇒ Boolean
- #see_also_links ⇒ Object
- #subscribe? ⇒ Boolean
Constructor Details
#initialize(component, description:, explore_links:, follow_links:, subscribe:, see_also_links:) ⇒ Sidebar
Use the ‘sidebar` module method on `Willamette`
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/willamette/strategies/sidebar.rb', line 8 def initialize( component, description:, explore_links:, follow_links:, subscribe:, see_also_links: ) @component = component @description = description @explore_links = explore_links || [] @follow_links = follow_links || [] @subscribe = subscribe @see_also_links = see_also_links || [] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/willamette/strategies/sidebar.rb', line 5 def description @description end |
Instance Method Details
#default_link_icon(folder: false) ⇒ Object
35 36 37 |
# File 'lib/willamette/strategies/sidebar.rb', line 35 def default_link_icon(folder: false) folder ? "folder-open" : "file-lines" end |
#description? ⇒ Boolean
23 |
# File 'lib/willamette/strategies/sidebar.rb', line 23 def description? = @description && !explore? |
#explore? ⇒ Boolean
19 |
# File 'lib/willamette/strategies/sidebar.rb', line 19 def explore? = !@explore_links.empty? |
#explore_links ⇒ Object
21 |
# File 'lib/willamette/strategies/sidebar.rb', line 21 def explore_links = links_html(@explore_links) |
#follow? ⇒ Boolean
25 |
# File 'lib/willamette/strategies/sidebar.rb', line 25 def follow? = !@follow_links.empty? |
#follow_links ⇒ Object
27 |
# File 'lib/willamette/strategies/sidebar.rb', line 27 def follow_links = links_html(@follow_links) |
#see_also? ⇒ Boolean
31 |
# File 'lib/willamette/strategies/sidebar.rb', line 31 def see_also? = !@see_also_links.empty? |
#see_also_links ⇒ Object
33 |
# File 'lib/willamette/strategies/sidebar.rb', line 33 def see_also_links = links_html(@see_also_links) |
#subscribe? ⇒ Boolean
29 |
# File 'lib/willamette/strategies/sidebar.rb', line 29 def subscribe? = @subscribe |