Sha256: 738e0bca2a2d0208a5dd08578aade77de0e2ef5688adb01e5e6cf5789a2ef5d8

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

# dry-configurable <a href="https://gitter.im/dryrb/chat" target="_blank">![Join the chat at https://gitter.im/dryrb/chat](https://badges.gitter.im/Join%20Chat.svg)</a>

<a href="https://rubygems.org/gems/dry-configurable" target="_blank">![Gem Version](https://badge.fury.io/rb/dry-configurable.svg)</a>
<a href="https://travis-ci.org/dryrb/dry-configurable" target="_blank">![Build Status](https://travis-ci.org/dryrb/dry-configurable.svg?branch=master)</a>
<a href="http://inch-ci.org/github/dryrb/dry-configurable" target="_blank">![Inline docs](http://inch-ci.org/github/dryrb/dry-configurable.svg?branch=master&style=flat)</a>

## Synopsis

```ruby
class App
  extend Dry::Configurable

  # Pass a block for nested configuration (works to any depth)
  setting :database do
    # Can pass a default value
    setting :dsn, 'sqlite:memory'
  end
  # Defaults to nil if no default value is given
  setting :adapter
end

App.configure do |config|
  config.database.dsn = 'jdbc:sqlite:memory'
end

App.config.database.dsn
# => 'jdbc:sqlite:memory'
App.config.adapter # => nil
```

## License

See `LICENSE` file.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dry-configurable-0.1.1 README.md
dry-configurable-0.1.0 README.md