Class: TCFG::Base

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/tcfg/tcfg_base.rb

Overview

The TCFG::Base object can used an instance of configuration

All of the methods from TCFG::Helper are available as instance methods

cfg = TCFG::Base.new
cfg.tcfg_set 'my_key', 'my_value'

cfg['my_key']
=> 'my_value'

cfg.tcfg
=> { 'my_key' => 'my_value', ... }

Constant Summary

Constants included from Helper

Helper::DEFAULT_CONFIG_FILE, Helper::DEFAULT_ENV_VAR_PREFIX

Instance Method Summary collapse

Methods included from Helper

#tcfg, #tcfg_config_file, #tcfg_fetch, #tcfg_get, #tcfg_reset, #tcfg_secret_config_file, #tcfg_set, #tcfg_set_env_var_prefix

Instance Method Details

#[](key) ⇒ Object

the simplest way to acces configuration

cfg['my_key']
=> 'some_value'

See Also:



26
27
28
# File 'lib/tcfg/tcfg_base.rb', line 26

def [](key)
  tcfg_get key
end