Class: Shoehorn::Components::Navigation
- Defined in:
- lib/shoehorn/components/navigation.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(elements, options = {}) ⇒ Navigation
constructor
A new instance of Navigation.
- #to_s ⇒ Object
Constructor Details
#initialize(elements, options = {}) ⇒ Navigation
Returns a new instance of Navigation.
5 6 7 8 |
# File 'lib/shoehorn/components/navigation.rb', line 5 def initialize(elements, = {}) super @elements = elements end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
3 4 5 |
# File 'lib/shoehorn/components/navigation.rb', line 3 def collection @collection end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/shoehorn/components/navigation.rb', line 10 def to_s output_buffer << content_tag(:ul, :class => build_class) do html = "" @elements.each do |e| html_class = build_html_class(e) html << content_tag(:li, e.to_s, html_class) end html.html_safe end super end |