Class: DAF::DynamicActionDaemon

Inherits:
Object
  • Object
show all
Defined in:
lib/daf.rb

Overview

This class represents the Dynamic Action Daemon it requires a set of commands to be passed in

Instance Method Summary collapse

Constructor Details

#initialize(commands) ⇒ DynamicActionDaemon

Initializes DAD with a given command set

Parameters:

  • commands (Array)

    Array containing Command objects



39
40
41
# File 'lib/daf.rb', line 39

def initialize(commands)
  @commands = commands
end

Instance Method Details

#startObject

Starts the daemon - this method will block for duration of execution of program



45
46
47
48
# File 'lib/daf.rb', line 45

def start
  @commands.each(&:execute)
  sleep
end