Class: Nezumi::Push
- Inherits:
-
Object
- Object
- Nezumi::Push
- Defined in:
- lib/nezumi/push.rb
Class Method Summary collapse
Class Method Details
.notify(message, opts = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/nezumi/push.rb', line 4 def self.notify(, opts = {}) url = ENV['NEZUMI_URL'] sound = opts.fetch(:sound, "default") push = opts.fetch(:push, true) raise URLNotSetError.new if url.nil? || url.empty? raise ArgumentError.new("Message must not be blank") if .nil? || .empty? RestClient.post(url, { :message => , :sound => sound, :push => !!push }) end |