Class: Tap::Signals::Configure

Inherits:
Tap::Signal show all
Defined in:
lib/tap/signals/configure.rb

Instance Attribute Summary

Attributes inherited from Tap::Signal

#block, #obj

Instance Method Summary collapse

Methods inherited from Tap::Signal

#initialize, #inspect, #process

Constructor Details

This class inherits a constructor from Tap::Signal

Instance Method Details

#call(config) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/tap/signals/configure.rb', line 4

def call(config)
  if config.kind_of?(Array)
    psr = ConfigParser.new(:add_defaults => false)
    psr.add(obj.class.configurations)
    args = psr.parse!(config)
    psr.warn_ignored_args(args)
    
    config = psr.config
  end
  
  obj.reconfigure(config)
  obj.config
end