Class: CampfireChat::Notification
- Inherits:
-
Object
- Object
- CampfireChat::Notification
- Defined in:
- lib/campfire_chat/notification.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(more_message) ⇒ Object
- #add_title(another_title) ⇒ Object
- #body ⇒ Object
- #error! ⇒ Object
- #error? ⇒ Boolean
- #important! ⇒ Object
- #important? ⇒ Boolean
-
#initialize(message) ⇒ Notification
constructor
A new instance of Notification.
- #title ⇒ Object
Constructor Details
#initialize(message) ⇒ Notification
Returns a new instance of Notification.
11 12 13 14 15 16 17 |
# File 'lib/campfire_chat/notification.rb', line 11 def initialize() @message = @additional_messages = [] @titles = [] @important = false @error = false end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/campfire_chat/notification.rb', line 3 def @message end |
Class Method Details
.build(message) ⇒ Object
5 6 7 8 9 |
# File 'lib/campfire_chat/notification.rb', line 5 def self.build() notification = new() CampfireChat::Checks.process(notification) notification end |
Instance Method Details
#<<(more_message) ⇒ Object
23 24 25 |
# File 'lib/campfire_chat/notification.rb', line 23 def <<() @additional_messages << end |
#add_title(another_title) ⇒ Object
27 28 29 |
# File 'lib/campfire_chat/notification.rb', line 27 def add_title(another_title) @titles << another_title end |
#body ⇒ Object
19 20 21 |
# File 'lib/campfire_chat/notification.rb', line 19 def body (@additional_messages + [.body]).join("\n") end |
#error! ⇒ Object
43 44 45 |
# File 'lib/campfire_chat/notification.rb', line 43 def error! @error = true end |
#error? ⇒ Boolean
47 48 49 |
# File 'lib/campfire_chat/notification.rb', line 47 def error? @error end |
#important! ⇒ Object
39 40 41 |
# File 'lib/campfire_chat/notification.rb', line 39 def important! @important = true end |
#important? ⇒ Boolean
35 36 37 |
# File 'lib/campfire_chat/notification.rb', line 35 def important? @important end |
#title ⇒ Object
31 32 33 |
# File 'lib/campfire_chat/notification.rb', line 31 def title @titles.join("\n") end |