Skip to content

Commit

Permalink
[load-values/instant-configuration] documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
0exp committed Dec 5, 2019
1 parent d1ebe91 commit 276e890
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2351,11 +2351,11 @@ config = Config.new # => Qonfig::FileNotFoundError
### Load setting values from YAML file (by instance)

- prvoides an ability to load predefined setting values from a yaml file;
- `#load_from_yaml(file_path, strict: true, expose: nil, &configuration)`
- `#load_from_yaml(file_path, strict: true, expose: nil, &configurations)`
- `file_path` - full file path or `:self` (`:self` means "load setting values from __END__ data");
- `:strict` - rerquires that file (or __END__-data) should exist (`true` by default);
- `:expose` - what the environment-based subset of keys should be used (`nil` means "do not use any subset of keys") (`nil` by default);
- `&configuration` - `do |config|` ability :)
- `&configurations` - `do |config|` ability :)

#### Default behavior

Expand Down Expand Up @@ -2450,11 +2450,11 @@ config.settings.creds.auth_token # => "kek.pek" (from config.yml)
### Load setting values from JSON file (by instance)

- prvoides an ability to load predefined setting values from a json file;
- `#load_from_json(file_path, strict: true, expose: nil, &configuration)`
- `#load_from_json(file_path, strict: true, expose: nil, &configurations)`
- `file_path` - full file path or `:self` (`:self` means "load setting values from __END__ data");
- `:strict` - rerquires that file (or __END__-data) should exist (`true` by default);
- `:expose` - what the environment-based subset of keys should be used (`nil` means "do not use any subset of keys") (`nil` by default);
- `&configuration` - `do |config|` ability :)
- `&configurations` - `do |config|` ability :)

#### Default behavior

Expand Down Expand Up @@ -2559,12 +2559,12 @@ config.settings.creds.auth_token # => "kek.pek" (from config.json)
### Load setting values from \_\_END\_\_ (by instance)

- prvoides an ability to load predefined setting values from `__END__` file section;
- `#load_from_self(strict: true, expose: nil, &configuration)`
- `#load_from_self(strict: true, expose: nil, &configurations)`
- `:format` - defines the format of file (`:dynamic` means "try to automatically infer the file format") (`:dynamic` by default);
- supports `:yaml`, `:json`, `:toml` (via `Qonfig.plugin(:toml)`), `:dynamic` (automatic format detection);
- `:strict` - requires that __END__-data should exist (`true` by default);
- `:expose` - what the environment-based subset of keys should be used (`nil` means "do not use any subset of keys") (`nil` by default);
- `&configuration` - `do |config|` ability :)
- `&configurations` - `do |config|` ability :)

#### Default behavior

Expand Down Expand Up @@ -2648,13 +2648,13 @@ __END__

- prvoides an ability to load predefined setting values from a file;
- works in instance-based `#load_from_yaml` / `#load_from_json` / `#load_from_self` manner;
- signature: `#load_from_file(file_path, format: :dynamic, strict: true, expose: nil, &configuration)`:
- signature: `#load_from_file(file_path, format: :dynamic, strict: true, expose: nil, &configurations)`:
- `file_path` - full file path or `:self` (`:self` means "load setting values from __END__ data");
- `:format` - defines the format of file (`:dynamic` means "try to automatically infer the file format") (`:dynamic` by default);
- supports `:yaml`, `:json`, `:toml` (via `Qonfig.plugin(:toml)`), `:dynamic` (automatic format detection);
- `:strict` - rerquires that file (or __END__-data) should exist (`true` by default);
- `:expose` - what the environment-based subset of keys should be used (`nil` means "do not use any subset of keys") (`nil` by default);
- `&configuration` - `do |config|` ability :)
- `&configurations` - `do |config|` ability :)
- see examples for instance-based `#load_from_yaml` ([doc](#load-setting-values-from-yaml-by-instance)) / `#load_from_json` ([doc](#load-setting-values-from-json-by-instance)) / `#load_from_self` ([doc](#load-setting-values-from-__end__-by-instance));

---
Expand Down

0 comments on commit 276e890

Please sign in to comment.