Class: Untied::Event
- Inherits:
-
Object
- Object
- Untied::Event
- Defined in:
- lib/untied-publisher/event.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(attrs) ⇒ Event
Returns a new instance of Event.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/untied-publisher/event.rb', line 7 def initialize(attrs) @config = { :name => "after_create", :payload => nil, :origin => nil, :payload_representer => nil }.merge(attrs) raise "You should inform the origin service" unless @config[:origin] @name = @config.delete(:name) @payload = represent(@config.delete(:payload)) @origin = @config.delete(:origin) self.extend(Publisher::EventRepresenter) end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/untied-publisher/event.rb', line 5 def name @name end |
#origin ⇒ Object
Returns the value of attribute origin.
5 6 7 |
# File 'lib/untied-publisher/event.rb', line 5 def origin @origin end |
#payload ⇒ Object
Returns the value of attribute payload.
5 6 7 |
# File 'lib/untied-publisher/event.rb', line 5 def payload @payload end |