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.
24 25 26 |
# File 'lib/ruby_event_store/mappers/transformation/upcast.rb', line 24 def initialize(upcast_map) @record_upcaster = RecordUpcaster.new(upcast_map) end |
Instance Method Details
#dump(record) ⇒ Object
28 29 30 |
# File 'lib/ruby_event_store/mappers/transformation/upcast.rb', line 28 def dump(record) record end |
#load(record) ⇒ Object
32 33 34 |
# File 'lib/ruby_event_store/mappers/transformation/upcast.rb', line 32 def load(record) @record_upcaster.call(record) end |