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.



43
44
45
# File 'lib/prowly/interface.rb', line 43

def initialize
  @url = "https://prowl.weks.net/publicapi"
end

Instance Method Details

#call(command, params) ⇒ Object

Make the actual call to the prowl api



48
49
50
51
52
53
# File 'lib/prowly/interface.rb', line 48

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