module NMA

This is the main Notify My Andoid module

Constants

VERSION

Public Instance Methods

notify(notification = Notification.new) { |notification| ... } click to toggle source
# File lib/ruby-notify-my-android.rb, line 11
def notify(notification = Notification.new)
  yield notification if block_given?
  Request.instance.call Request::Command::NOTIFY, notification.to_params
end
remaining_calls(key) click to toggle source
# File lib/ruby-notify-my-android.rb, line 25
def remaining_calls(key)
  result = verify(key)
  return result.response["remaining"].to_i if result.succeeded?
  result.response["content"]
end
valid_key?(key) click to toggle source
# File lib/ruby-notify-my-android.rb, line 20
def valid_key?(key)
  result = verify(key)
  result.succeeded?
end
verify(apikey) click to toggle source
# File lib/ruby-notify-my-android.rb, line 16
def verify(apikey)
  Request.instance.call Request::Command::VERIFY, "apikey=#{apikey}"
end
version() click to toggle source
# File lib/ruby-notify-my-android.rb, line 31
def version
  File.read(File.join(File.dirname(__FILE__), *%w[.. VERSION]))
end