Class: Eac::MenusHelper::GuiBuilder
- Inherits:
-
Object
- Object
- Eac::MenusHelper::GuiBuilder
- Defined in:
- lib/eac/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.
4 5 6 |
# File 'lib/eac/menus_helper/gui_builder.rb', line 4 def initialize(view) @view = view end |
Instance Method Details
#build(entries, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/eac/menus_helper/gui_builder.rb', line 8 def build(entries, = {}) fail "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 |