Class: WithEvents::Aws::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/with_events/aws/message.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Message

Returns a new instance of Message.



13
14
15
16
17
18
# File 'lib/with_events/aws/message.rb', line 13

def initialize(options = {})
  @options = options.with_indifferent_access
  @event = @options[:event]
  @stream = @options[:stream]
  @identifier = @options[:identifier]
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



9
10
11
# File 'lib/with_events/aws/message.rb', line 9

def event
  @event
end

#identifierObject (readonly) Also known as: id

Returns the value of attribute identifier.



9
10
11
# File 'lib/with_events/aws/message.rb', line 9

def identifier
  @identifier
end

#streamObject (readonly)

Returns the value of attribute stream.



9
10
11
# File 'lib/with_events/aws/message.rb', line 9

def stream
  @stream
end

Class Method Details

.from_sqs(options = {}) ⇒ Object



24
25
26
# File 'lib/with_events/aws/message.rb', line 24

def self.from_sqs(options = {})
  new(options.deep_transform_keys { |key| key.to_s.underscore })
end

Instance Method Details

#serializeObject



20
21
22
# File 'lib/with_events/aws/message.rb', line 20

def serialize
  options.deep_transform_keys { |key| key.to_s.camelize(:lower) }
end