Class: EacRailsUtils::MenusHelper::GuiBuilder
- Inherits:
-
Object
- Object
- EacRailsUtils::MenusHelper::GuiBuilder
- Defined in:
- app/helpers/eac_rails_utils/menus_helper/gui_builder.rb
Instance Method Summary collapse
- #build(entries, options = {}) ⇒ Object
-
#initialize(view) ⇒ GuiBuilder
constructor
A new instance of GuiBuilder.
Constructor Details
#initialize(view) ⇒ GuiBuilder
Returns a new instance of GuiBuilder.
6 7 8 |
# File 'app/helpers/eac_rails_utils/menus_helper/gui_builder.rb', line 6 def initialize(view) @view = view end |
Instance Method Details
#build(entries, options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/helpers/eac_rails_utils/menus_helper/gui_builder.rb', line 10 def build(entries, = {}) raise 'Argument "entries" is not a array' unless entries.is_a?(Array) @view.content_tag(:ul, ) do b = ActiveSupport::SafeBuffer.new entries.map { |v| (v) }.each { |e| b << e } b end end |