Class: Rabbit::EventHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbit/event_handler.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ EventHandler

Returns a new instance of EventHandler.



32
33
34
35
36
37
38
# File 'lib/rabbit/event_handler.rb', line 32

def initialize(message)
  assign_attributes(message.data)

  self.data = message.data
  self.project_id = message.project_id
  self.message_info = message.arguments
end

Class Attribute Details

.additional_job_configsObject

Returns the value of attribute additional_job_configs.



9
10
11
# File 'lib/rabbit/event_handler.rb', line 9

def additional_job_configs
  @additional_job_configs
end

.ignore_queue_conversionObject

Returns the value of attribute ignore_queue_conversion.



9
10
11
# File 'lib/rabbit/event_handler.rb', line 9

def ignore_queue_conversion
  @ignore_queue_conversion
end

.queueObject

Returns the value of attribute queue.



9
10
11
# File 'lib/rabbit/event_handler.rb', line 9

def queue
  @queue
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



6
7
8
# File 'lib/rabbit/event_handler.rb', line 6

def data
  @data
end

#message_infoObject

Returns the value of attribute message_info.



6
7
8
# File 'lib/rabbit/event_handler.rb', line 6

def message_info
  @message_info
end

#project_idObject

Returns the value of attribute project_id.



6
7
8
# File 'lib/rabbit/event_handler.rb', line 6

def project_id
  @project_id
end

Class Method Details

.inherited(subclass) ⇒ Object



11
12
13
14
15
# File 'lib/rabbit/event_handler.rb', line 11

def inherited(subclass)
  super
  subclass.ignore_queue_conversion = false
  subclass.additional_job_configs = {}
end

Instance Method Details

#assign_attributes(attrs = {}) ⇒ Object



40
41
42
43
44
45
# File 'lib/rabbit/event_handler.rb', line 40

def assign_attributes(attrs = {})
  attrs.each do |key, value|
    setter = "#{key}="
    public_send(setter, value) if respond_to?(setter)
  end
end