Class: NMA::Request

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/ruby-notify-my-android/request.rb

Defined Under Namespace

Modules: Command

Instance Method Summary collapse

Constructor Details

#initializeRequest

Returns a new instance of Request.



10
11
12
# File 'lib/ruby-notify-my-android/request.rb', line 10

def initialize
  @url = "https://www.notifymyandroid.com/publicapi"
end

Instance Method Details

#call(command, params) ⇒ Object

Make the actual call to the api



15
16
17
18
19
20
# File 'lib/ruby-notify-my-android/request.rb', line 15

def call(command, params)
  @command = command
  request = Net::HTTP::Get.new(uri.request_uri + "?" + params)
  response = http.request(request)
  Response.new(response)
end