Module: Serega::SeregaPlan::InstanceMethods
- Included in:
- Serega::SeregaPlan
- Defined in:
- lib/serega/plan.rb
Overview
SeregaPlan instance methods
Instance Attribute Summary collapse
-
#has_batch_points ⇒ Array<SeregaPlanPoint>
readonly
Shows if plan includes batch points.
-
#parent_plan_point ⇒ SeregaPlanPoint?
readonly
Parent plan point.
-
#points ⇒ Array<SeregaPlanPoint>
readonly
Serialization points.
Instance Method Summary collapse
-
#initialize(parent_plan_point, modifiers) ⇒ SeregaPlan
Instantiate new serialization plan.
-
#mark_as_has_batch_points ⇒ Object
Marks current plan and top-level plans as ‘has_batch_points` It is needed to initialize Batch Attribute Loaders when serialization starts.
-
#serializer_class ⇒ Object
Serializer class of current plan.
Instance Attribute Details
#has_batch_points ⇒ Array<SeregaPlanPoint> (readonly)
Shows if plan includes batch points
70 71 72 |
# File 'lib/serega/plan.rb', line 70 def has_batch_points @has_batch_points end |
#parent_plan_point ⇒ SeregaPlanPoint? (readonly)
Parent plan point
62 63 64 |
# File 'lib/serega/plan.rb', line 62 def parent_plan_point @parent_plan_point end |
#points ⇒ Array<SeregaPlanPoint> (readonly)
Serialization points
66 67 68 |
# File 'lib/serega/plan.rb', line 66 def points @points end |
Instance Method Details
#initialize(parent_plan_point, modifiers) ⇒ SeregaPlan
Instantiate new serialization plan
Patched by
- depth_limit plugin, which checks depth limit is not exceeded when adding new plan
86 87 88 89 90 |
# File 'lib/serega/plan.rb', line 86 def initialize(parent_plan_point, modifiers) @has_batch_points = false # should be before assigning points, generated points can change this attribute @parent_plan_point = parent_plan_point @points = attributes_points(modifiers) end |
#mark_as_has_batch_points ⇒ Object
Marks current plan and top-level plans as ‘has_batch_points` It is needed to initialize Batch Attribute Loaders when serialization starts
103 104 105 106 107 108 |
# File 'lib/serega/plan.rb', line 103 def mark_as_has_batch_points return if has_batch_points @has_batch_points = true parent_plan_point.plan.mark_as_has_batch_points if parent_plan_point # rubocop:disable Style/SafeNavigation end |
#serializer_class ⇒ Object
Serializer class of current plan
95 96 97 |
# File 'lib/serega/plan.rb', line 95 def serializer_class self.class.serializer_class end |