Method: NetworkExecutive::ProgramSchedule#initialize
- Defined in:
- lib/network_executive/program_schedule.rb
#initialize(program, options = {}, &block) ⇒ ProgramSchedule
Returns a new instance of ProgramSchedule.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/network_executive/program_schedule.rb', line 9 def initialize( program, = {}, &block ) .symbolize_keys! [:duration] ||= 24.hours @start_time, @duration = [:start_time], [:duration] @program = Program.find_by_name program raise ProgramNameError, %Q{"#{program}" is not a registered Program} unless @program @block = block end |