Confstruct is a versatile config object for Ruby

Exposing configuration options to API consumers is a common programming scenario. In Ruby, configuration via block is a popular approach:

Gowalla.configure do |config|
  config.api_key = 'your_api_key'
  config.username = 'pengwynn'
  config.password = 'somepassword'
gowalla =

Confstruct from Michael B. Klein makes it easy to expose this sort of API configuration as well as hash-based and dot notation styles.

config.github[:url] = ''
config[:github].branch = 'pre-1.0'

Confstruct also supports a number of ! methods to add temporary overrides, safe lookups, and array appending. Check the README for advanced usage.

News Films

Our little film studio focuses on telling developer-centric stories that need to be seen.

GopherCon 2016 Conference Recap

0:00 / 0:00