Sha256: 3417196811f61ad7225759030ba7ba6111182b0109ae124e7ddc48aaf55ee108

Contents?: true

Size: 558 Bytes

Versions: 10

Compression:

Stored size: 558 Bytes

Contents

require 'configuration/configurable'

# An example of adding configuration options to a class, seperated by
# namespaces.
class NamespaceExample
  configurable

  config_path 'example/002_namespace_example.ini'

  define :bar do
    description 'foo_bar'
    type :integer
    default 1
  end

  namespace :foo do
    define :bar do
      description 'bar_foo'
      type :string
      default 'Hello, world!'
    end
  end
end

example = NamespaceExample.new
puts example.config.inspect
puts example.bar
puts example.config[:foo_bar]
puts example.foo[:bar]

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
confuse-0.1.8 example/002_namespace_example.rb
confuse-0.1.7 example/002_namespace_example.rb
confuse-0.1.6 example/002_namespace_example.rb
confuse-0.1.5 example/002_namespace_example.rb
confuse-0.1.4 example/002_namespace_example.rb
confuse-0.1.3 example/002_namespace_example.rb
confuse-0.1.2 example/002_namespace_example.rb
confuse-0.1.1 example/002_namespace_example.rb
confuse-0.1.0 example/002_namespace_example.rb
confuse-0.0.1 example/002_namespace_example.rb