Method: R10K::Settings::List#initialize

Defined in:
lib/r10k/settings/list.rb

#initialize(name, item_proc, opts = {}) ⇒ List

Returns a new instance of List.

Parameters:

  • name (Symbol)

    The name of the setting for this definition.

  • item_proc (#call)

    An object whose #call method will return a new instance of another R10K::Settings class to hold each item added to this list.

  • opts (Hash) (defaults to: {})

    Additional options for this definition to control validation, normalization, and the like.



27
28
29
30
31
32
33
# File 'lib/r10k/settings/list.rb', line 27

def initialize(name, item_proc, opts = {})
  @name = name
  @item_proc = item_proc
  @items = []

  setopts(opts, allowed_initialize_opts)
end