Class: Configuratron

Inherits:
BlankSlate show all
Defined in:
lib/configuratron.rb

Defined Under Namespace

Modules: Configurable Classes: ConfigHash

Instance Method Summary collapse

Methods inherited from BlankSlate

find_hidden_method, hide, reveal

Constructor Details

#initializeConfiguratron

Returns a new instance of Configuratron.



4
5
6
# File 'lib/configuratron.rb', line 4

def initialize
  @config = ConfigHash.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



16
17
18
# File 'lib/configuratron.rb', line 16

def method_missing(name, *args, &block)
  @config.__send__(name, *args, &block)
end

Instance Method Details

#[](key) ⇒ Object



8
9
10
# File 'lib/configuratron.rb', line 8

def [](key)
  @config[key]
end

#[]=(key, value) ⇒ Object



12
13
14
# File 'lib/configuratron.rb', line 12

def []=(key, value)
  @config[key] = value
end