Class: Itsi::Server::Config::Watch

Inherits:
Option
  • Object
show all
Defined in:
lib/itsi/server/config/options/watch.rb

Instance Method Summary collapse

Methods included from ConfigHelpers

included, load_and_register, #normalize_keys!

Constructor Details

#initialize(location, path, commands) ⇒ Watch

Returns a new instance of Watch.



12
13
14
15
16
# File 'lib/itsi/server/config/options/watch.rb', line 12

def initialize(location, path, commands)
  @path = path
  @commands = commands
  super(location, nil)
end

Instance Method Details

#build!Object



18
19
20
21
22
23
24
# File 'lib/itsi/server/config/options/watch.rb', line 18

def build!
  path, commands = @path, @commands
  location.instance_eval do
    @options[:notify_watchers] ||= []
    @options[:notify_watchers] << [path, commands]
  end
end