Sha256: 6b87be69d75c07a51c0c9de5e020de9d7f05808fc269456a13e45b013b858462

Contents?: true

Size: 877 Bytes

Versions: 8

Compression:

Stored size: 877 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.read(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.read(path), permitted_classes: [Symbol])
          @baseline = Logic::Helpers::Hash.symbolize_keys(cartridge)
          @baseline
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nano-bots-0.1.1 logic/cartridge/default.rb
nano-bots-0.1.0 logic/cartridge/default.rb
nano-bots-0.0.10 logic/cartridge/default.rb
nano-bots-0.0.9 logic/cartridge/default.rb
nano-bots-0.0.8 logic/cartridge/default.rb
nano-bots-0.0.7 logic/cartridge/default.rb
nano-bots-0.0.6 logic/cartridge/default.rb
nano-bots-0.0.5 logic/cartridge/default.rb