Class: FoundationNavigation::Topbar
- Inherits:
-
Object
- Object
- FoundationNavigation::Topbar
- Includes:
- Builder
- Defined in:
- lib/foundation-navigation/topbar.rb
Instance Attribute Summary
Attributes included from Builder
Instance Method Summary collapse
-
#initialize(contain_to_grid: false, fixed: false, sticky: true, **args, &block) ⇒ Topbar
constructor
A new instance of Topbar.
- #navigation(**args, &block) ⇒ Object
Methods included from Builder
#build_subtree, #divider, #dropdown, #left, #menu_group, #menu_item, #method_missing, #right, #title_area, #to_s
Constructor Details
#initialize(contain_to_grid: false, fixed: false, sticky: true, **args, &block) ⇒ Topbar
Returns a new instance of Topbar.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/foundation-navigation/topbar.rb', line 17 def initialize(contain_to_grid: false, fixed: false, sticky: true, **args, &block) if contain_to_grid || fixed || sticky classes = [] classes << 'contain-to-grid' if contain_to_grid classes << 'fixed' if fixed classes << 'sticky' if sticky div(class: classes.join(' ')) { (**args, &block) } else (**args, &block) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FoundationNavigation::Builder
Instance Method Details
#navigation(**args, &block) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/foundation-navigation/topbar.rb', line 10 def (**args, &block) nav(class: 'top-bar') do build_subtree(::TitleArea, **args) section(class: 'top-bar-section', &block) end end |