Sha256: b2460deac45e5436dfb93c5ea461e702cc3ea3f158958dba1b998f7277c384d0

Contents?: true

Size: 478 Bytes

Versions: 16

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

require 'yaml'
require 'hashie'
require 'active_support/all'
require_relative 'komeda/item'
require_relative 'komeda/version'

module Komeda
  MENUS_FILE_PATH = "#{File.dirname(__FILE__)}/../config/menus.yaml"

  menus = YAML.load_file(MENUS_FILE_PATH, aliases: true, permitted_classes: [Time]).deep_symbolize_keys

  menus.each_key do |key|
    define_singleton_method(key) do
      menus[key].map { |item| Komeda::Item[item] }
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
komeda-0.2.4 lib/komeda.rb
komeda-0.2.3 lib/komeda.rb
komeda-0.2.2 lib/komeda.rb
komeda-0.2.1 lib/komeda.rb
komeda-0.2.0 lib/komeda.rb
komeda-0.1.14 lib/komeda.rb
komeda-0.1.13 lib/komeda.rb
komeda-0.1.12 lib/komeda.rb
komeda-0.1.10 lib/komeda.rb
komeda-0.1.9 lib/komeda.rb
komeda-0.1.8 lib/komeda.rb
komeda-0.1.7 lib/komeda.rb
komeda-0.1.6 lib/komeda.rb
komeda-0.1.5 lib/komeda.rb
komeda-0.1.4 lib/komeda.rb
komeda-0.1.3 lib/komeda.rb