Class: Navigatrix::Rendering::Strategies::List

Inherits:
Struct
  • Object
show all
Includes:
ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper
Defined in:
lib/navigatrix/rendering/strategies/list.rb

Direct Known Subclasses

Bootstrap::Navbar, Bootstrap::Tabs

Defined Under Namespace

Classes: HTMLAttributes, Item

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#items=(value) ⇒ Object

Sets the attribute items

Parameters:

  • value (Object)

    the value to set the attribute items to.

Returns:

  • (Object)

    the newly set value



4
5
6
# File 'lib/navigatrix/rendering/strategies/list.rb', line 4

def items=(value)
  @items = value
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



4
5
6
# File 'lib/navigatrix/rendering/strategies/list.rb', line 4

def options
  @options
end

Instance Method Details

#renderObject



8
9
10
# File 'lib/navigatrix/rendering/strategies/list.rb', line 8

def render
  (:ul, render_items, html_attributes)
end

#render_itemsObject



12
13
14
# File 'lib/navigatrix/rendering/strategies/list.rb', line 12

def render_items
  items.map(&:render).join.html_safe
end