Class: MultiScheduler::Schedule

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

Direct Known Subclasses

Launchd, Whenever

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, options = {}) ⇒ Schedule

Returns a new instance of Schedule.



7
8
9
10
11
12
13
14
15
# File 'lib/multi_scheduler/schedule.rb', line 7

def initialize id, options = {}

  @identifier = id
  raise "identifier is required" unless @identifier

  @command_arguments = [ options[:args] ].flatten.compact
  @command = options[:command] || @command_arguments.shift
  raise "command is required" unless @command
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



5
6
7
# File 'lib/multi_scheduler/schedule.rb', line 5

def command
  @command
end

#command_argumentsObject (readonly)

Returns the value of attribute command_arguments.



5
6
7
# File 'lib/multi_scheduler/schedule.rb', line 5

def command_arguments
  @command_arguments
end

#identifierObject (readonly)

Returns the value of attribute identifier.



5
6
7
# File 'lib/multi_scheduler/schedule.rb', line 5

def identifier
  @identifier
end