Sha256: ec900e505bb2c3883affb7079044b5217493568c1d5a4b4d70d32f7558c9d8af
Contents?: true
Size: 610 Bytes
Versions: 1
Compression:
Stored size: 610 Bytes
Contents
# frozen_string_literal: true module HeavyControl module Configurable def config(&block) reset! unless @config return @config if block.nil? instance_eval(&block) end private # DSL methods def reset! @config = { debug: false, ignore_subfolders: [], always_load: [] } end def debug(_value = true) @config[:debug] = true end def ignore_subfolder(subfolder) @config[:ignore_subfolders] << subfolder end def always_load(*const_names) @config[:always_load] += const_names end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
heavy_control-0.1.1 | lib/heavy_control/configurable.rb |