Module: Kubes::Hooks::Dsl

Included in:
Builder
Defined in:
lib/kubes/hooks/dsl.rb

Instance Method Summary collapse

Instance Method Details

#after(*commands, **props) ⇒ Object



9
10
11
12
13
# File 'lib/kubes/hooks/dsl.rb', line 9

def after(*commands, **props)
  commands.each do |name|
    each_hook(:after, name, props)
  end
end

#before(*commands, **props) ⇒ Object



3
4
5
6
7
# File 'lib/kubes/hooks/dsl.rb', line 3

def before(*commands, **props)
  commands.each do |name|
    each_hook(:before, name, props)
  end
end

#each_hook(type, name, props = {}) ⇒ Object



15
16
17
18
# File 'lib/kubes/hooks/dsl.rb', line 15

def each_hook(type, name, props={})
  @hooks[type][name] ||= []
  @hooks[type][name] << props
end