Class: RubyEventStore::Mappers::Transformation::Upcast

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_event_store/mappers/transformation/upcast.rb

Defined Under Namespace

Classes: RecordUpcaster

Instance Method Summary collapse

Constructor Details

#initialize(upcast_map) ⇒ Upcast

Returns a new instance of Upcast.


23
24
25
# File 'lib/ruby_event_store/mappers/transformation/upcast.rb', line 23

def initialize(upcast_map)
  @record_upcaster = RecordUpcaster.new(upcast_map)
end

Instance Method Details

#dump(record) ⇒ Object


27
28
29
# File 'lib/ruby_event_store/mappers/transformation/upcast.rb', line 27

def dump(record)
  record
end

#load(record) ⇒ Object


31
32
33
# File 'lib/ruby_event_store/mappers/transformation/upcast.rb', line 31

def load(record)
  @record_upcaster.call(record)
end