Class: VagrantDNS::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-dns.rb

Class Method Summary collapse

Class Method Details

.hook_once(middleware, hook) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/vagrant-dns.rb', line 40

def self.hook_once(middleware, hook)
  return if hook.append_hooks.any? { |stack_item|
    if stack_item.is_a?(Array)
      stack_item.first == middleware
    else
      stack_item.middleware == middleware
    end

  }
  hook.append middleware
end