Method: Guts::Configuration#method_missing

Defined in:
lib/guts/configuration.rb

#method_missing(name, *args) ⇒ Object

Getter and setter method for configuration so that there is not a set amount of configs

Parameters:

  • name (String)

    the config name

  • args (Array)

    list of args (used for setting)

Returns:

  • the configuration requested



22
23
24
25
26
27
28
29
30
# File 'lib/guts/configuration.rb', line 22

def method_missing(name, *args)
  name = name.to_s

  if name =~ /=$/
    instance_variable_set "@#{name.chop}", args.first
  else
    instance_variable_get "@#{name}"
  end
end