Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[conditional_expose] An ability to conditaionally expose values from files #129

Open
0exp opened this issue Mar 22, 2021 · 0 comments
Open

Comments

@0exp
Copy link
Owner

0exp commented Mar 22, 2021

For example:

class Config < Qonfig::DataSet
  setting :kek, expose_if: -> { some_code }
  # or
  setting :kek, expose_if: :some_method_name
  # ---
  values_file 'kek.yml' # or load_from_file (or yaml or json or etc)
end

# ---
## true for expose_if
config.kek # => '123' (some value from a kek.yml file)
## false for expose_if
config.kek # => nil (empty value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant