Merge pull request #129 from ParamagicDev/patch-1
docs: add a note about configuration blocks
This commit is contained in:
commit
615623e778
|
@ -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"
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue