Class: RubyEventStore::Mappers::Transformation::Upcast
- Inherits:
-
Object
- Object
- RubyEventStore::Mappers::Transformation::Upcast
- Defined in:
- lib/ruby_event_store/mappers/transformation/upcast.rb
Defined Under Namespace
Classes: RecordUpcaster
Instance Method Summary collapse
- #dump(record) ⇒ Object
-
#initialize(upcast_map) ⇒ Upcast
constructor
A new instance of Upcast.
- #load(record) ⇒ Object
Constructor Details
#initialize(upcast_map) ⇒ Upcast
Returns a new instance of Upcast.
19 20 21 |
# File 'lib/ruby_event_store/mappers/transformation/upcast.rb', line 19 def initialize(upcast_map) @record_upcaster = RecordUpcaster.new(upcast_map) end |
Instance Method Details
#dump(record) ⇒ Object
23 24 25 |
# File 'lib/ruby_event_store/mappers/transformation/upcast.rb', line 23 def dump(record) record end |
#load(record) ⇒ Object
27 28 29 |
# File 'lib/ruby_event_store/mappers/transformation/upcast.rb', line 27 def load(record) @record_upcaster.call(record) end |