Class: RubyEventStore::Mappers::PipelineMapper

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

Direct Known Subclasses

Default, EncryptionMapper, NullMapper

Instance Method Summary collapse

Constructor Details

#initialize(pipeline) ⇒ PipelineMapper

Returns a new instance of PipelineMapper.


6
7
8
# File 'lib/ruby_event_store/mappers/pipeline_mapper.rb', line 6

def initialize(pipeline)
  @pipeline = pipeline
end

Instance Method Details

#event_to_record(domain_event) ⇒ Object


10
11
12
# File 'lib/ruby_event_store/mappers/pipeline_mapper.rb', line 10

def event_to_record(domain_event)
  pipeline.dump(domain_event)
end

#record_to_event(record) ⇒ Object


14
15
16
# File 'lib/ruby_event_store/mappers/pipeline_mapper.rb', line 14

def record_to_event(record)
  pipeline.load(record)
end