Class: Quova::QOD

Inherits:
Object
  • Object
show all
Defined in:
lib/quova/qod.rb

Overview

Interface to the Quova QOD (Quova On Demand) service

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ QOD

Initialize the QOD client with Quova API credentials

Examples:

Quova::QOD.new(:id => "account-id", :password => "account-password")


17
18
19
20
# File 'lib/quova/qod.rb', line 17

def initialize(options)
  base = "https://%s:%[email protected]/ipinfo"
  @resource = RestClient::Resource.new(base % [options[:id], options[:password]])
end

Instance Method Details

#info(ip) ⇒ Quova::Result<Virtus> Also known as: []

Query the API for a given IP address

Examples:

qod.info("4.2.2.2") # => { ... }


62
63
64
# File 'lib/quova/qod.rb', line 62

def info(ip)
  parse_xml(@resource[ip.to_s].get.body)
end