Module: Configurize

Defined in:
lib/configurize.rb

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



6
7
8
# File 'lib/configurize.rb', line 6

def [](key)
  config[key.to_sym]
end

#[]=(key, value) ⇒ Object



10
11
12
13
# File 'lib/configurize.rb', line 10

def []=(key, value) 
  config[key.to_sym] = value
  write_config
end

#configObject



15
16
17
# File 'lib/configurize.rb', line 15

def config
  @config ||= load_config
end

#to_sObject



19
20
21
# File 'lib/configurize.rb', line 19

def to_s
  "#{self.name}: #{printable_config}"
end