Sha256: 31a1a09c94afb9aaa69170e7b35b5369f5e4056e05907fe2d7a83364889d35cd

Contents?: true

Size: 414 Bytes

Versions: 29

Compression:

Stored size: 414 Bytes

Contents

module Symphonia
  module MenuManager
    @@mapper = {}
    mattr_accessor :mapper

    def self.menu(name)
      return mapper[name.to_sym] || {}
    end

    class << self
      def map(menu_name)
        mapper[menu_name] ||= {}
        if block_given?
          yield mapper[menu_name]
        end
      end

      def clear(menu_name)
        !mapper.delete(menu_name.to_sym).nil?
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
symphonia-4.2.0 lib/symphonia/menu_manager.rb
symphonia-4.1.3 lib/symphonia/menu_manager.rb
symphonia-4.1.2 lib/symphonia/menu_manager.rb
symphonia-4.1.1 lib/symphonia/menu_manager.rb
symphonia-4.1.0 lib/symphonia/menu_manager.rb
symphonia-4.0.1 lib/symphonia/menu_manager.rb
symphonia-4.0.0 lib/symphonia/menu_manager.rb
symphonia-3.4.0 lib/symphonia/menu_manager.rb
symphonia-3.3.4 lib/symphonia/menu_manager.rb
symphonia-3.3.3 lib/symphonia/menu_manager.rb
symphonia-3.3.2 lib/symphonia/menu_manager.rb
symphonia-3.3.0 lib/symphonia/menu_manager.rb
symphonia-3.2.4 lib/symphonia/menu_manager.rb
symphonia-3.2.3 lib/symphonia/menu_manager.rb
symphonia-3.2.2 lib/symphonia/menu_manager.rb
symphonia-3.2.1 lib/symphonia/menu_manager.rb
symphonia-3.1.5 lib/symphonia/menu_manager.rb
symphonia-3.1.4 lib/symphonia/menu_manager.rb
symphonia-3.1.3 lib/symphonia/menu_manager.rb
symphonia-3.1.2 lib/symphonia/menu_manager.rb