Class: PerfectSched::Application::Decider

Inherits:
Object
  • Object
show all
Defined in:
lib/perfectsched/application/decider.rb

Direct Known Subclasses

DefaultDecider

Instance Method Summary collapse

Constructor Details

#initialize(base) ⇒ Decider

Returns a new instance of Decider.



27
28
29
# File 'lib/perfectsched/application/decider.rb', line 27

def initialize(base)
  @base = base
end

Instance Method Details

#decide!(type, opts = {}) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/perfectsched/application/decider.rb', line 39

def decide!(type, opts={})
  begin
    m = method(type)
  rescue NameError
    raise UndefinedDecisionError, "Undefined decision #{type} options=#{opts.inspect}"
  end
  m.call(opts)
end

#schedulesObject



31
32
33
# File 'lib/perfectsched/application/decider.rb', line 31

def schedules
  @base.schedules
end

#taskObject



35
36
37
# File 'lib/perfectsched/application/decider.rb', line 35

def task
  @base.task
end