Class: Prowly::Interface

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/prowly/interface.rb

Overview

This is the actual Prowl API wrapper

Usage:

prowl_api = Prowly::Interface.instance

prowl_api.call(Prowly::Command::ADD, params)

Defined Under Namespace

Modules: Command Classes: NoAPIKeyGiven

Instance Method Summary collapse

Constructor Details

#initializeInterface

Returns a new instance of Interface.



20
21
22
# File 'lib/prowly/interface.rb', line 20

def initialize
  @url = "https://api.prowlapp.com/publicapi"
end

Instance Method Details

#call(command, params) ⇒ Object

Make the actual call to the prowl api



25
26
27
28
29
30
# File 'lib/prowly/interface.rb', line 25

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