Method: Configure::Value#put

Defined in:
lib/configure/value.rb

#put(value) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/configure/value.rb', line 26

def put(value)
  check_only_list!
  method_name = :"#{@key}="
  if @configuration.respond_to?(method_name)
    @configuration.send method_name, value
  elsif @configuration.respond_to?(:[]=)
    @configuration[@key] = value
  else
    raise Configure::InvalidKeyError, "couldn't set configuration value for key #{@key}!"
  end
end