Class: RailsSimpleEventSourcing::AggregateLinksBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_simple_event_sourcing/aggregate_links_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ AggregateLinksBuilder

Returns a new instance of AggregateLinksBuilder.



5
6
7
# File 'lib/rails_simple_event_sourcing/aggregate_links_builder.rb', line 5

def initialize(data)
  @data = data
end

Instance Method Details

#callObject



9
10
11
12
13
# File 'lib/rails_simple_event_sourcing/aggregate_links_builder.rb', line 9

def call
  return {} if @data.blank?

  @data.filter_map { |key, value| entry_for(key.to_s, value) }.to_h
end