Class: Quova::REST
- Inherits:
-
Object
- Object
- Quova::REST
- Defined in:
- lib/quova/rest.rb
Overview
Interface to the standard Quova REST API.
Instance Method Summary collapse
-
#info(ip) ⇒ Quova::Result<Virtus>
(also: #[])
Query the API for a given IP address.
-
#initialize(options) ⇒ REST
constructor
Initialize the REST client with the Quova credentials.
Constructor Details
#initialize(options) ⇒ REST
Initialize the REST client with the Quova credentials.
19 20 21 22 |
# File 'lib/quova/rest.rb', line 19 def initialize() @options = .dup @resource = RestClient::Resource.new("http://api.quova.com/v1/ipinfo") end |
Instance Method Details
#info(ip) ⇒ Quova::Result<Virtus> Also known as: []
Query the API for a given IP address
64 65 66 |
# File 'lib/quova/rest.rb', line 64 def info(ip) parse_xml(@resource[ip].get(:params => params_for_ip(ip)).body) end |