Class: EacRailsUtils::MenusHelper::BootstrapGuiBuilder

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/eac_rails_utils/menus_helper/bootstrap_gui_builder.rb

Overview

Instance Method Summary collapse

Constructor Details

#initialize(view, options = {}) ⇒ BootstrapGuiBuilder

Returns a new instance of BootstrapGuiBuilder.


7
8
9
10
# File 'app/helpers/eac_rails_utils/menus_helper/bootstrap_gui_builder.rb', line 7

def initialize(view, options = {})
  @view = view
  @options = options
end

Instance Method Details

#build(entries) ⇒ Object


12
13
14
15
16
17
18
# File 'app/helpers/eac_rails_utils/menus_helper/bootstrap_gui_builder.rb', line 12

def build(entries)
  raise 'Argument "entries" is not a array' unless entries.is_a?(Array)

  @view.(:ul, class: "nav navbar-nav #{@options[:class]}".strip) do
    menu_entries(entries)
  end
end