Class: LedgerSync::Serialization::Type::SerializerType
- Defined in:
- lib/ledger_sync/serialization/type/serializer_type.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#serializer ⇒ Object
readonly
Returns the value of attribute serializer.
Instance Method Summary collapse
- #convert(args = {}) ⇒ Object
-
#initialize(args = {}) ⇒ SerializerType
constructor
A new instance of SerializerType.
Constructor Details
#initialize(args = {}) ⇒ SerializerType
Returns a new instance of SerializerType.
11 12 13 |
# File 'lib/ledger_sync/serialization/type/serializer_type.rb', line 11 def initialize(args = {}) @serializer = args.fetch(:serializer) end |
Instance Attribute Details
#serializer ⇒ Object (readonly)
Returns the value of attribute serializer.
9 10 11 |
# File 'lib/ledger_sync/serialization/type/serializer_type.rb', line 9 def serializer @serializer end |
Instance Method Details
#convert(args = {}) ⇒ Object
15 16 17 18 19 |
# File 'lib/ledger_sync/serialization/type/serializer_type.rb', line 15 def convert(args = {}) value = args.fetch(:value) serializer.new.serialize(resource: value) end |