Class: ProcessWanker::ConfigDaemonServiceBuilder
- Inherits:
-
Builder
- Object
- Builder
- ProcessWanker::ConfigDaemonServiceBuilder
show all
- Defined in:
- lib/config/config_daemon_service.rb
Instance Method Summary
collapse
Methods inherited from Builder
#build, #klass
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/config/config_daemon_service.rb', line 62
def method_missing(method,*args,&block)
if(block)
@config.params[method] = block
elsif(args.length == 0)
@config.params[method] = true
elsif(args.length == 1)
@config.params[method] = args[0]
else
@config.params[method] = args
end
end
|
Instance Method Details
#depends(*args, &block) ⇒ Object
57
58
59
60
|
# File 'lib/config/config_daemon_service.rb', line 57
def depends(*args,&block)
@config.params[:dependencies] ||= []
@config.params[:dependencies] << ConfigDaemonServiceDependencyBuilder.new.build(@config,args,block)
end
|
#hook(pattern, &block) ⇒ Object
48
49
50
|
# File 'lib/config/config_daemon_service.rb', line 48
def hook(pattern,&block)
@config.hooks << ConfigHook.new(@config,pattern,block)
end
|
52
53
54
55
|
# File 'lib/config/config_daemon_service.rb', line 52
def tags(*t)
@config.params[:tags] ||= []
@config.params[:tags] += t
end
|