Class: WipeOut::Plans::Union
- Inherits:
-
Object
- Object
- WipeOut::Plans::Union
- Defined in:
- lib/wipe_out/plans/union.rb
Instance Attribute Summary collapse
-
#plans ⇒ Object
readonly
Returns the value of attribute plans.
Instance Method Summary collapse
- #establish_execution_plan(record) ⇒ Object
-
#initialize(plans, selector) ⇒ Union
constructor
A new instance of Union.
Constructor Details
#initialize(plans, selector) ⇒ Union
Returns a new instance of Union.
6 7 8 9 |
# File 'lib/wipe_out/plans/union.rb', line 6 def initialize(plans, selector) @plans = plans @selector = selector end |
Instance Attribute Details
#plans ⇒ Object (readonly)
Returns the value of attribute plans.
4 5 6 |
# File 'lib/wipe_out/plans/union.rb', line 4 def plans @plans end |
Instance Method Details
#establish_execution_plan(record) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/wipe_out/plans/union.rb', line 11 def establish_execution_plan(record) plan = @selector.call(record).plan raise "Plan #{plan} is not listed in #{@plans}" unless @plans.include?(plan) plan end |