Module: SimplySerializable::Mixin
- Defined in:
- lib/simply_serializable/mixin.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #simply_serializable_id ⇒ Object
- #simply_serialize(cache: {}, **options) ⇒ Object
- #simply_serializer(cache: {}, **options) ⇒ Object
Class Method Details
.included(base) ⇒ Object
36 37 38 39 |
# File 'lib/simply_serializable/mixin.rb', line 36 def self.included(base) base.include(Fingerprintable::Mixin) base.extend(ClassMethods) end |
Instance Method Details
#simply_serializable_id ⇒ Object
56 57 58 |
# File 'lib/simply_serializable/mixin.rb', line 56 def simply_serializable_id simply_serializer.id end |
#simply_serialize(cache: {}, **options) ⇒ Object
41 42 43 |
# File 'lib/simply_serializable/mixin.rb', line 41 def simply_serialize(cache: {}, **) simply_serializer(cache: cache, **).serialize end |
#simply_serializer(cache: {}, **options) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/simply_serializable/mixin.rb', line 45 def simply_serializer(cache: {}, **) Serializer.new( **self.class.simply_serializable_config.merge( ).merge( cache: cache, object: self ) ) end |