Class: NoSE::Plans::InsertPlanStep
- Inherits:
-
UpdatePlanStep
- Object
- PlanStep
- UpdatePlanStep
- NoSE::Plans::InsertPlanStep
- Defined in:
- lib/nose/plans/update.rb
Overview
A step which inserts data into a given index
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Attributes inherited from UpdatePlanStep
Attributes inherited from PlanStep
#children, #cost, #parent, #state
Instance Method Summary collapse
-
#initialize(index, state = nil, fields = Set.new) ⇒ InsertPlanStep
constructor
A new instance of InsertPlanStep.
Methods inherited from UpdatePlanStep
Methods inherited from PlanStep
#add_fields_from_index, #calculate_cost, inherited, #parent_index, #parent_steps, #to_color
Methods included from Supertype
Constructor Details
#initialize(index, state = nil, fields = Set.new) ⇒ InsertPlanStep
Returns a new instance of InsertPlanStep.
42 43 44 45 46 47 48 49 50 |
# File 'lib/nose/plans/update.rb', line 42 def initialize(index, state = nil, fields = Set.new) super index, :insert, state @fields = if fields.empty? index.all_fields else fields.to_set & index.all_fields end @fields += index.hash_fields + index.order_fields.to_set end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
40 41 42 |
# File 'lib/nose/plans/update.rb', line 40 def fields @fields end |