Class: Controll::Notify::Message::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/controll/notify/message/handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ Handler

Returns a new instance of Handler.



8
9
10
# File 'lib/controll/notify/message/handler.rb', line 8

def initialize message
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/controll/notify/message/handler.rb', line 6

def message
  @message
end

Instance Method Details

#handleObject



12
13
14
15
16
# File 'lib/controll/notify/message/handler.rb', line 12

def handle
  return args? ? replace_args : message.text
rescue StandardError
  nil
end