Class: EventEngine::Event

Inherits:
Struct
  • Object
show all
Defined in:
lib/event_engine/event.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#aggregate_idObject

Returns the value of attribute aggregate_id

Returns:

  • (Object)

    the current value of aggregate_id



2
3
4
# File 'lib/event_engine/event.rb', line 2

def aggregate_id
  @aggregate_id
end

#aggregate_typeObject

Returns the value of attribute aggregate_type

Returns:

  • (Object)

    the current value of aggregate_type



2
3
4
# File 'lib/event_engine/event.rb', line 2

def aggregate_type
  @aggregate_type
end

#aggregate_versionObject

Returns the value of attribute aggregate_version

Returns:

  • (Object)

    the current value of aggregate_version



2
3
4
# File 'lib/event_engine/event.rb', line 2

def aggregate_version
  @aggregate_version
end

#domainObject

Returns the value of attribute domain

Returns:

  • (Object)

    the current value of domain



2
3
4
# File 'lib/event_engine/event.rb', line 2

def domain
  @domain
end

#event_nameObject

Returns the value of attribute event_name

Returns:

  • (Object)

    the current value of event_name



2
3
4
# File 'lib/event_engine/event.rb', line 2

def event_name
  @event_name
end

#event_typeObject

Returns the value of attribute event_type

Returns:

  • (Object)

    the current value of event_type



2
3
4
# File 'lib/event_engine/event.rb', line 2

def event_type
  @event_type
end

#event_versionObject

Returns the value of attribute event_version

Returns:

  • (Object)

    the current value of event_version



2
3
4
# File 'lib/event_engine/event.rb', line 2

def event_version
  @event_version
end

#idempotency_keyObject

Returns the value of attribute idempotency_key

Returns:

  • (Object)

    the current value of idempotency_key



2
3
4
# File 'lib/event_engine/event.rb', line 2

def idempotency_key
  @idempotency_key
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



2
3
4
# File 'lib/event_engine/event.rb', line 2

def 
  @metadata
end

#occurred_atObject

Returns the value of attribute occurred_at

Returns:

  • (Object)

    the current value of occurred_at



2
3
4
# File 'lib/event_engine/event.rb', line 2

def occurred_at
  @occurred_at
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



2
3
4
# File 'lib/event_engine/event.rb', line 2

def payload
  @payload
end

#process_typeObject

Returns the value of attribute process_type

Returns:

  • (Object)

    the current value of process_type



2
3
4
# File 'lib/event_engine/event.rb', line 2

def process_type
  @process_type
end

#subjectObject

Returns the value of attribute subject

Returns:

  • (Object)

    the current value of subject



2
3
4
# File 'lib/event_engine/event.rb', line 2

def subject
  @subject
end

Class Method Details

.from(record) ⇒ Object



18
19
20
21
22
# File 'lib/event_engine/event.rb', line 18

def self.from(record)
  attrs = members.to_h { |member| [member, record.public_send(member)] }
  attrs[:payload] = attrs[:payload].to_h.transform_keys(&:to_sym)
  new(**attrs)
end