Class: SimpleObjectSerialization::ObjectSerializer
- Inherits:
-
Object
- Object
- SimpleObjectSerialization::ObjectSerializer
- Defined in:
- lib/simple_object_serialization/object_serializer.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#serializer_class ⇒ Object
readonly
Returns the value of attribute serializer_class.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(serializer_class, object, options) ⇒ ObjectSerializer
constructor
A new instance of ObjectSerializer.
Constructor Details
#initialize(serializer_class, object, options) ⇒ ObjectSerializer
Returns a new instance of ObjectSerializer.
7 8 9 10 11 |
# File 'lib/simple_object_serialization/object_serializer.rb', line 7 def initialize(serializer_class, object, ) @serializer_class = serializer_class @object = object = end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
5 6 7 |
# File 'lib/simple_object_serialization/object_serializer.rb', line 5 def object @object end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/simple_object_serialization/object_serializer.rb', line 5 def end |
#serializer_class ⇒ Object (readonly)
Returns the value of attribute serializer_class.
5 6 7 |
# File 'lib/simple_object_serialization/object_serializer.rb', line 5 def serializer_class @serializer_class end |
Class Method Details
.call(*params, **options, &block) ⇒ Object
13 14 15 |
# File 'lib/simple_object_serialization/object_serializer.rb', line 13 def self.call(*params, **, &block) new(*params, **).call(&block) end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 |
# File 'lib/simple_object_serialization/object_serializer.rb', line 17 def call { data: data, meta: } end |