Module: Serega::SeregaObjectSerializer::SeregaObjectSerializerInstanceMethods
- Included in:
- Serega::SeregaObjectSerializer
- Defined in:
- lib/serega/object_serializer.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#many ⇒ Object
readonly
Returns the value of attribute many.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
Instance Method Summary collapse
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/serega/object_serializer.rb', line 6 def context @context end |
#many ⇒ Object (readonly)
Returns the value of attribute many.
6 7 8 |
# File 'lib/serega/object_serializer.rb', line 6 def many @many end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
6 7 8 |
# File 'lib/serega/object_serializer.rb', line 6 def opts @opts end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
6 7 8 |
# File 'lib/serega/object_serializer.rb', line 6 def points @points end |
Instance Method Details
#initialize(context:, points:, many: nil, **opts) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/serega/object_serializer.rb', line 11 def initialize(context:, points:, many: nil, **opts) @context = context @points = points @many = many @opts = opts end |
#serialize(object) ⇒ Object
19 20 21 |
# File 'lib/serega/object_serializer.rb', line 19 def serialize(object) array?(object, many) ? serialize_array(object) : serialize_object(object) end |