Module: Serega::SeregaPlanPoint::InstanceMethods

Extended by:
Forwardable
Included in:
Serega::SeregaPlanPoint
Defined in:
lib/serega/plan_point.rb

Overview

SeregaPlanPoint instance methods

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributeSeregaAttribute (readonly)

Shows current attribute

Returns:



20
21
22
# File 'lib/serega/plan_point.rb', line 20

def attribute
  @attribute
end

#child_fieldsSeregaPlan? (readonly)

Child fields to serialize

Returns:

  • (SeregaPlan, nil)

    Attribute serialization plan



28
29
30
# File 'lib/serega/plan_point.rb', line 28

def child_fields
  @child_fields
end

#child_planSeregaPlan? (readonly)

Shows child plan if exists

Returns:

  • (SeregaPlan, nil)

    Attribute serialization plan



24
25
26
# File 'lib/serega/plan_point.rb', line 24

def child_plan
  @child_plan
end

#planSeregaAttribute (readonly)

Link to current plan this point belongs to

Returns:



16
17
18
# File 'lib/serega/plan_point.rb', line 16

def plan
  @plan
end

Instance Method Details

#child_object_serializerSeregaObjectSerializer

Returns object serializer for child plan.

Returns:



64
65
66
# File 'lib/serega/plan_point.rb', line 64

def child_object_serializer
  serializer::SeregaObjectSerializer
end

#initialize(attribute, plan = nil, child_fields = nil) ⇒ SeregaPlanPoint

Initializes plan point

Parameters:

  • plan (SeregaPlan) (defaults to: nil)

    Plan where this point belongs to.

  • attribute (SeregaAttribute)

    Attribute to construct plan point

  • child_fields (Hash, nil) (defaults to: nil)

    Child fields (:only, :with, :except)

Returns:



53
54
55
56
57
58
59
# File 'lib/serega/plan_point.rb', line 53

def initialize(attribute, plan = nil, child_fields = nil)
  @plan = plan
  @attribute = attribute
  @child_fields = child_fields
  set_normalized_vars
  freeze
end

#manyObject

Attribute ‘many` option



42
# File 'lib/serega/plan_point.rb', line 42

def_delegators :@attribute, :name, :value, :many, :serializer

#nameObject

Attribute ‘name`



42
# File 'lib/serega/plan_point.rb', line 42

def_delegators :@attribute, :name, :value, :many, :serializer

#serializerObject

Attribute ‘serializer` option



42
# File 'lib/serega/plan_point.rb', line 42

def_delegators :@attribute, :name, :value, :many, :serializer

#valueObject

Attribute ‘value` block



42
# File 'lib/serega/plan_point.rb', line 42

def_delegators :@attribute, :name, :value, :many, :serializer