Class: Burble
- Inherits:
-
Object
- Object
- Burble
- Defined in:
- lib/burble.rb,
lib/burble/growl-sender.rb,
lib/burble/snarl-sender.rb,
lib/burble/mumbles-sender.rb
Defined Under Namespace
Classes: Growl_Sender, Mumbles_Sender, Snarl_Sender
Class Method Summary collapse
- .send(title, text) ⇒ Object
-
.send?(title, text) ⇒ Boolean
send? behaves just the same as send, except that it won’t raise any errors.
Class Method Details
.send(title, text) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/burble.rb', line 9 def send(title, text) raise "No sender found!" unless SENDER raise "Invalid sender!" unless SENDER.respond_to?("send") SENDER.send(title, text) end |
.send?(title, text) ⇒ Boolean
send? behaves just the same as send, except that it won’t raise any errors. This should be used when burbling would be nice, but it’s ok if the host machine doesn’t have any systems installed that support it.
20 21 22 23 24 25 26 |
# File 'lib/burble.rb', line 20 def send?(title, text) begin send(title, text) rescue #do nothing end end |