Sha256: ce8880f3cecf4ec745246d3151f8744ab93d347816acce5a2ecb5265b25faacc

Contents?: true

Size: 557 Bytes

Versions: 67

Compression:

Stored size: 557 Bytes

Contents

# encoding: utf-8
class MenuBuilder

  def initialize
    @elements = []
  end

  def dropdown(text,icon,submenu)
    @elements << { :type => 'dropdown' , :text => text, :icon => icon, :link => submenu }
    return self
  end

  def link(text,icon,link,target)
    @elements << { :type => 'link' , :text => text, :icon => icon, :link => link, :target => target }
    return self
  end

  def modal(text,icon,link)
    @elements << { :type => 'modal' , :text => text, :icon => icon, :link => link }
    return self
  end

  def build
    @elements
  end

end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
sinatra-hexacta-1.7.20 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.19 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.18 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.17 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.16 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.15 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.14 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.13 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.12 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.11 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.10 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.9 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.8 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.7 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.6 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.5 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.4 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.3 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.2 lib/sinatra/extensions/menu.rb
sinatra-hexacta-1.7.0 lib/sinatra/extensions/menu.rb