Class: Eye::Patch::OptionSet

Inherits:
Hash
  • Object
show all
Defined in:
lib/eye/patch/option_set.rb

Instance Method Summary collapse

Constructor Details

#initialize(option_class, options) ⇒ OptionSet

Returns a new instance of OptionSet.



7
8
9
10
11
12
# File 'lib/eye/patch/option_set.rb', line 7

def initialize(option_class, options)
  Array(options).each do |option|
    option_data = option_class.name_and_class(option[:name].to_sym)
    self[option_data[:name]] = option[:config].merge(type: option_data[:type])
  end
end