Module: EntityStore::Event

Defined in:
lib/entity_store/event.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entity_idObject

Returns the value of attribute entity_id.



5
6
7
# File 'lib/entity_store/event.rb', line 5

def entity_id
  @entity_id
end

#entity_versionObject

Returns the value of attribute entity_version.



5
6
7
# File 'lib/entity_store/event.rb', line 5

def entity_version
  @entity_version
end

Class Method Details

.included(klass) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/entity_store/event.rb', line 7

def self.included(klass)
  klass.class_eval do
    include Attributes
    include HashSerialization
    extend ClassMethods
  end
end

Instance Method Details

#inspectObject



52
53
54
# File 'lib/entity_store/event.rb', line 52

def inspect
  "<#{self.class.name} #{self.attributes.inspect}>"
end

#receiver_nameObject



15
16
17
18
19
20
21
22
# File 'lib/entity_store/event.rb', line 15

def receiver_name
  elements = self.class.name.split('::')
  elements[elements.count - 1].
     gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
     gsub(/([a-z\d])([A-Z])/,'\1_\2').
     tr("-", "_").
     downcase
end