Class: Golden::Menu::OptionHelper
- Inherits:
-
Object
- Object
- Golden::Menu::OptionHelper
- Defined in:
- lib/golden/menu/option_helper.rb
Instance Attribute Summary collapse
-
#linked ⇒ Object
Returns the value of attribute linked.
-
#menu_type ⇒ Object
Returns the value of attribute menu_type.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(args) ⇒ OptionHelper
constructor
A new instance of OptionHelper.
- #linked? ⇒ Boolean
- #menu_li_class ⇒ Object
- #menu_ul_class ⇒ Object
- #submenu_li_class ⇒ Object
Constructor Details
#initialize(args) ⇒ OptionHelper
8 9 10 11 12 13 |
# File 'lib/golden/menu/option_helper.rb', line 8 def initialize args @menu_type = args.delete(:menu_type) || [] @linked = args.delete(:menu_linked) @linked = false if @linked.nil? @options = args end |
Instance Attribute Details
#linked ⇒ Object
Returns the value of attribute linked.
5 6 7 |
# File 'lib/golden/menu/option_helper.rb', line 5 def linked @linked end |
#menu_type ⇒ Object
Returns the value of attribute menu_type.
4 5 6 |
# File 'lib/golden/menu/option_helper.rb', line 4 def @menu_type end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/golden/menu/option_helper.rb', line 6 def @options end |
Instance Method Details
#linked? ⇒ Boolean
35 36 37 |
# File 'lib/golden/menu/option_helper.rb', line 35 def linked? linked end |
#menu_li_class ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/golden/menu/option_helper.rb', line 19 def if .include? 'dropup' { class: 'dropup' } else { class: 'dropdown' } end end |
#menu_ul_class ⇒ Object
15 16 17 |
# File 'lib/golden/menu/option_helper.rb', line 15 def { class: 'nav' }.deep_merge end |
#submenu_li_class ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/golden/menu/option_helper.rb', line 27 def if .include? 'pull-left' { class: 'dropdown-submenu pull-left' } else { class: 'dropdown-submenu' } end end |