Class: Hermes::EventHandler::Registration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(handler, consumer, options = {}) ⇒ Registration

Returns a new instance of Registration.



44
45
46
47
48
# File 'lib/hermes/event_handler.rb', line 44

def initialize(handler, consumer, options = {})
  @handler = handler
  @consumer = consumer
  @options = options
end

Instance Attribute Details

#consumerObject (readonly)

Returns the value of attribute consumer.



42
43
44
# File 'lib/hermes/event_handler.rb', line 42

def consumer
  @consumer
end

#handlerObject (readonly)

Returns the value of attribute handler.



42
43
44
# File 'lib/hermes/event_handler.rb', line 42

def handler
  @handler
end

#optionsObject (readonly)

Returns the value of attribute options.



42
43
44
# File 'lib/hermes/event_handler.rb', line 42

def options
  @options
end

Instance Method Details

#async?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/hermes/event_handler.rb', line 50

def async?
  options.fetch(:async) == true
end

#consumer_configObject



58
59
60
# File 'lib/hermes/event_handler.rb', line 58

def consumer_config
  optons.fetch(:consumer_config)
end

#rpc?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/hermes/event_handler.rb', line 54

def rpc?
  options.fetch(:rpc) == true
end