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

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

Direct Known Subclasses

Error, Info, Success, Warning

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

check_type

Constructor Details

#initialize(message) ⇒ AbstractNotification

Returns a new instance of AbstractNotification.



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

def initialize(message)
  super(CGI.unescapeHTML(message))

  @time = Time.now
end

Instance Attribute Details

#timeObject (readonly)

Returns the value of attribute time.



7
8
9
# File 'lib/twterm/event/notification/abstract_notification.rb', line 7

def time
  @time
end

Instance Method Details

#colorObject

Raises:

  • (NotImplementedError)


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

def color
  raise NotImplementedError, 'color method must be overridden'
end

#fieldsObject



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

def fields
  {
    message: String
  }
end