Class: PerfectSched::Application::Decider
- Inherits:
-
Object
- Object
- PerfectSched::Application::Decider
- Defined in:
- lib/perfectsched/application/decider.rb
Direct Known Subclasses
Instance Method Summary collapse
- #decide!(type, opts = {}) ⇒ Object
-
#initialize(base) ⇒ Decider
constructor
A new instance of Decider.
- #schedules ⇒ Object
- #task ⇒ Object
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 |
#schedules ⇒ Object
31 32 33 |
# File 'lib/perfectsched/application/decider.rb', line 31 def schedules @base.schedules end |
#task ⇒ Object
35 36 37 |
# File 'lib/perfectsched/application/decider.rb', line 35 def task @base.task end |