Merge pull request #129 from ParamagicDev/patch-1

docs: add a note about configuration blocks
This commit is contained in:
Peter Solnica 2022-07-01 11:09:41 +02:00 committed by GitHub
commit 615623e778
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -53,3 +53,23 @@ App.pool
App.uploader.bucket
# => 'dev'
```
`dry-configurable` can also be used to pass a configuration block like you may have seen in
other gems.
Example:
```ruby
class App
extend Dry::Configurable
setting :database
end
App.config.database # => nil
App.configure do |config|
config.database = "postgres"
end
App.config.database # => "postgres"
```