class CampfireChat::Notification

Attributes

message[R]

Public Class Methods

build(message) click to toggle source
# File lib/campfire_chat/notification.rb, line 5
def self.build(message)
  notification = new(message)
  CampfireChat::Checks.process(notification)
  notification
end
new(message) click to toggle source
# File lib/campfire_chat/notification.rb, line 11
def initialize(message)
  @message = message
  @additional_messages = []
  @titles = []
  @important = false
  @error = false
end

Public Instance Methods

<<(more_message) click to toggle source
# File lib/campfire_chat/notification.rb, line 23
def <<(more_message)
  @additional_messages << more_message
end
add_title(another_title) click to toggle source
# File lib/campfire_chat/notification.rb, line 27
def add_title(another_title)
  @titles << another_title
end
body() click to toggle source
# File lib/campfire_chat/notification.rb, line 19
def body
  (@additional_messages + [message.body]).join("\n")
end
error!() click to toggle source
# File lib/campfire_chat/notification.rb, line 43
def error!
  @error = true
end
error?() click to toggle source
# File lib/campfire_chat/notification.rb, line 47
def error?
  @error
end
important!() click to toggle source
# File lib/campfire_chat/notification.rb, line 39
def important!
  @important = true
end
important?() click to toggle source
# File lib/campfire_chat/notification.rb, line 35
def important?
  @important
end
title() click to toggle source
# File lib/campfire_chat/notification.rb, line 31
def title
  @titles.join("\n")
end