Class: Twterm::Event::Notification::DirectMessage

Inherits:
AbstractNotification show all
Defined in:
lib/twterm/event/notification/direct_message.rb

Instance Method Summary collapse

Methods inherited from AbstractNotification

#fallback, #url

Methods inherited from AbstractEvent

#fields

Methods included from Utils

check_type

Constructor Details

#initialize(message, user) ⇒ DirectMessage

Returns a new instance of DirectMessage.

Parameters:



9
10
11
12
# File 'lib/twterm/event/notification/direct_message.rb', line 9

def initialize(message, user)
  @message = message
  @user = user
end

Instance Method Details

#bodyString

Returns notification body.

Returns:

  • (String)

    notification body



15
16
17
# File 'lib/twterm/event/notification/direct_message.rb', line 15

def body
  message.text
end

#titleString

Returns notification title.

Returns:

  • (String)

    notification title



20
21
22
# File 'lib/twterm/event/notification/direct_message.rb', line 20

def title
  "@#{user.screen_name} has sent you a message"
end