Module: Sandthorn::AggregateRoot::DirtyHashy
- Includes:
- Base
- Defined in:
- lib/sandthorn/aggregate_root_dirty_hashy.rb
Instance Attribute Summary
Attributes included from Base
#aggregate_current_event_version, #aggregate_events, #aggregate_id, #aggregate_originating_version, #aggregate_stored_serialized_object
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Base
#aggregate_base_initialize, #aggregate_trace, #all, #commit, #save
Instance Method Details
#aggregate_initialize ⇒ Object
13
14
15
|
# File 'lib/sandthorn/aggregate_root_dirty_hashy.rb', line 13
def aggregate_initialize
@hashy = ::DirtyHashy.new
end
|
#get_delta ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/sandthorn/aggregate_root_dirty_hashy.rb', line 17
def get_delta
.each do |var|
@hashy[var.to_s.delete("@")] = self.instance_variable_get("#{var}")
end
aggregate_attribute_deltas = []
@hashy.changes.each do |attribute|
aggregate_attribute_deltas << { :attribute_name => attribute[0], :old_value => attribute[1][0], :new_value => attribute[1][1]}
end
aggregate_attribute_deltas
end
|