Method: Ruber::SettingsContainer#default

Defined in:
lib/ruber/settings_container.rb

#default(group, name) ⇒ Object

The default value for a given setting

the value returned by the @relative_path@ method of the setting object (if it exists)

Parameters:

  • group (Sybmol)

    the group the setting belongs to

  • the (String)

    name of the setting

Returns:

  • (Object)

    the default value for the setting, without taking into account

Raises:

  • @IndexError@ if a setting with the given name and group hasn’t been added



339
340
341
342
343
344
# File 'lib/ruber/settings_container.rb', line 339

def default group, name
  opt = @known_options.fetch([group, name]) do
    raise IndexError, "No option called #{name} and belonging to group #{group} exists"
  end
  opt.default
end