Class: NotifierPlugin::HandlerAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/tecsgen/plugin/NotifierPlugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, error_name = nil) ⇒ HandlerAttribute

Returns a new instance of HandlerAttribute.



429
430
431
432
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 429

def initialize(name, error_name = nil)
  @name = name
  @error_name = error_name || (name + "ForError")
end

Instance Method Details

#name_for_handler(handler) ⇒ Object



434
435
436
437
438
439
440
# File 'lib/tecsgen/plugin/NotifierPlugin.rb', line 434

def name_for_handler(handler)
  case handler
  when EVENT_HANDLER then return @name
  when ERROR_HANDLER then return @error_name
  else raise "unknown handler #{handler}"
  end
end