Sha256: 06a9283766269d628ffbe6d3421dc580541fa0ae0f87f2c5195d86662065e758

Contents?: true

Size: 865 Bytes

Versions: 19

Compression:

Stored size: 865 Bytes

Contents

# frozen_string_literal: true

require 'yaml'
require 'singleton'

require_relative '../helpers/hash'

module NanoBot
  module Logic
    module Cartridge
      class Default
        include Singleton

        def values
          return @values if @values

          path = File.expand_path('../../static/cartridges/default.yml', __dir__)
          cartridge = YAML.safe_load_file(path, permitted_classes: [Symbol])
          @values = Logic::Helpers::Hash.symbolize_keys(cartridge)
          @values
        end

        def baseline
          return @baseline if @baseline

          path = File.expand_path('../../static/cartridges/baseline.yml', __dir__)
          cartridge = YAML.safe_load_file(path, permitted_classes: [Symbol])
          @baseline = Logic::Helpers::Hash.symbolize_keys(cartridge)
          @baseline
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
nano-bots-3.4.0 logic/cartridge/default.rb
nano-bots-3.3.0 logic/cartridge/default.rb
nano-bots-3.2.0 logic/cartridge/default.rb
nano-bots-3.0.1 logic/cartridge/default.rb
nano-bots-3.0.0 logic/cartridge/default.rb
nano-bots-2.5.1 logic/cartridge/default.rb
nano-bots-2.5.0 logic/cartridge/default.rb
nano-bots-2.4.1 logic/cartridge/default.rb
nano-bots-2.4.0 logic/cartridge/default.rb
nano-bots-2.3.0 logic/cartridge/default.rb
nano-bots-2.2.0 logic/cartridge/default.rb
nano-bots-2.1.0 logic/cartridge/default.rb
nano-bots-2.0.0 logic/cartridge/default.rb
nano-bots-1.2.0 logic/cartridge/default.rb
nano-bots-1.1.2 logic/cartridge/default.rb
nano-bots-1.1.1 logic/cartridge/default.rb
nano-bots-1.1.0 logic/cartridge/default.rb
nano-bots-1.0.1 logic/cartridge/default.rb
nano-bots-1.0.0 logic/cartridge/default.rb