Class: Twterm::Event::Notification::AbstractNotification Abstract

Inherits:
AbstractEvent
  • Object
show all
Defined in:
lib/twterm/event/notification/abstract_notification.rb

Overview

This class is abstract.

Direct Known Subclasses

Follow, Like, ListMemberAdded, Mention, Quote, Retweet

Instance Method Summary collapse

Methods inherited from AbstractEvent

#fields, #initialize

Methods included from Utils

check_type

Constructor Details

This class inherits a constructor from Twterm::Event::AbstractEvent

Instance Method Details

#bodyString

This method is abstract.

Returns notification body.

Returns:

  • (String)

    notification body

Raises:

  • (NotImplementedError)


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

def body
  raise NotImplementedError, '`body` must be implemented'
end

#fallbackString

Returns a fallback text.

Returns:

  • (String)

    a fallback text



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

def fallback
  "#{title}: #{body}"
end

#titleString

This method is abstract.

Returns notification title.

Returns:

  • (String)

    notification title

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/twterm/event/notification/abstract_notification.rb', line 21

def title
  raise NotImplementedError, '`fallback` must be implemented'
end

#urlString?

Returns notification URL.

Returns:

  • (String, nil)

    notification URL



26
27
28
# File 'lib/twterm/event/notification/abstract_notification.rb', line 26

def url
  nil
end