Method: LightConfig::Builder#method_missing

Defined in:
lib/light_config.rb

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



26
27
28
29
30
31
32
# File 'lib/light_config.rb', line 26

def method_missing(method, *args, &block)
  raise ArgumentError("wrong number of arguments(#{args.length} for 1)") unless args.length < 2
  value = if block then ::LightConfig::Configuration.new(&block)
          else args.first
          end
  @configuration.instance_variable_get(:@properties)[method] = value
end