Sha256: e588b7b189336ff83506a6f955031b23d40e4e9a9e21ae585a4654df12df3987

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 Bytes

Contents

require "menuizer/version"
require "menuizer/menu"
require "menuizer/menu/item"

module Menuizer
  class << self
    def configure(namespace=nil)
      yield config_for_namespace(namespace)
    end
    def menu(namespace=nil, **data)
      Menu.new namespace, config_for_namespace(namespace), data
    end

    private

      def config
        @config ||= {}
      end
      def config_for_namespace(namespace)
        config[namespace] ||= OpenStruct.new
      end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
menuizer-0.2.7 lib/menuizer.rb