Module: Serega::SeregaPlanPoint::InstanceMethods
- Included in:
- Serega::SeregaPlanPoint
- Defined in:
- lib/serega/plan_point.rb
Overview
SeregaPlanPoint instance methods
Instance Attribute Summary collapse
-
#attribute ⇒ SeregaAttribute
readonly
Shows current attribute.
-
#child_plan ⇒ SeregaPlan?
readonly
Shows child plan if exists.
-
#modifiers ⇒ Hash
readonly
Child fields to serialize.
-
#plan ⇒ SeregaAttribute
readonly
Link to current plan this point belongs to.
-
#preloads ⇒ Hash
readonly
Shows preloads for nested attributes.
-
#preloads_path ⇒ Array<Symbol>?
readonly
Shows preloads_path for current attribute.
Instance Method Summary collapse
- #batch? ⇒ Boolean
-
#batch_loaders ⇒ Object
Attribute ‘batch_loaders`.
-
#child_object_serializer ⇒ SeregaObjectSerializer
Object serializer for child plan.
-
#initialize(plan, attribute, modifiers = nil) ⇒ SeregaPlanPoint
Initializes plan point.
-
#many ⇒ Object
Attribute ‘many` option.
-
#name ⇒ Object
Attribute ‘name`.
-
#serializer ⇒ Object
Attribute ‘serializer` option.
-
#value(obj, ctx, batches: nil) ⇒ Object
Attribute ‘value`.
Instance Attribute Details
#attribute ⇒ SeregaAttribute (readonly)
Shows current attribute
18 19 20 |
# File 'lib/serega/plan_point.rb', line 18 def attribute @attribute end |
#child_plan ⇒ SeregaPlan? (readonly)
Shows child plan if exists
22 23 24 |
# File 'lib/serega/plan_point.rb', line 22 def child_plan @child_plan end |
#modifiers ⇒ Hash (readonly)
Child fields to serialize
26 27 28 |
# File 'lib/serega/plan_point.rb', line 26 def modifiers @modifiers end |
#plan ⇒ SeregaAttribute (readonly)
Link to current plan this point belongs to
14 15 16 |
# File 'lib/serega/plan_point.rb', line 14 def plan @plan end |
#preloads ⇒ Hash (readonly)
Shows preloads for nested attributes
30 31 32 |
# File 'lib/serega/plan_point.rb', line 30 def preloads @preloads end |
#preloads_path ⇒ Array<Symbol>? (readonly)
Shows preloads_path for current attribute
34 35 36 |
# File 'lib/serega/plan_point.rb', line 34 def preloads_path @preloads_path end |
Instance Method Details
#batch? ⇒ Boolean
79 80 81 |
# File 'lib/serega/plan_point.rb', line 79 def batch? !attribute.batch_loaders.empty? end |
#batch_loaders ⇒ Object
Attribute ‘batch_loaders`
85 86 87 |
# File 'lib/serega/plan_point.rb', line 85 def batch_loaders attribute.batch_loaders end |
#child_object_serializer ⇒ SeregaObjectSerializer
Returns object serializer for child plan.
92 93 94 |
# File 'lib/serega/plan_point.rb', line 92 def child_object_serializer serializer::SeregaObjectSerializer end |
#initialize(plan, attribute, modifiers = nil) ⇒ SeregaPlanPoint
Initializes plan point
48 49 50 51 52 53 |
# File 'lib/serega/plan_point.rb', line 48 def initialize(plan, attribute, modifiers = nil) @plan = plan @attribute = attribute @modifiers = modifiers set_normalized_vars end |
#many ⇒ Object
Attribute ‘many` option
69 70 71 |
# File 'lib/serega/plan_point.rb', line 69 def many attribute.many end |
#name ⇒ Object
Attribute ‘name`
63 64 65 |
# File 'lib/serega/plan_point.rb', line 63 def name attribute.name end |
#serializer ⇒ Object
Attribute ‘serializer` option
75 76 77 |
# File 'lib/serega/plan_point.rb', line 75 def serializer attribute.serializer end |
#value(obj, ctx, batches: nil) ⇒ Object
Attribute ‘value`
57 58 59 |
# File 'lib/serega/plan_point.rb', line 57 def value(obj, ctx, batches: nil) attribute.value(obj, ctx, batches: batches) end |