Sha256: 366d5612097f8a2dd97a900c30e5357eaf9441829c0484fed0a3fb7f4e6100db
Contents?: true
Size: 549 Bytes
Versions: 46
Compression:
Stored size: 549 Bytes
Contents
module Plutonium module Builders class SidebarMenu attr_reader :items def initialize(&) @items = [] instance_eval(&) end def item(name, indicator: nil, url: nil, &block) if block && indicator raise ArgumentError, "Items with children cannot have an indicator." end item = SidebarMenuItem.new(name, indicator: indicator) if block item.items(&block) else item.url(url) end @items << item end end end end
Version data entries
46 entries across 46 versions & 1 rubygems