class URLVoid::Host
Attributes
response[R]
Public Class Methods
info(api_key, hostname, opts={})
click to toggle source
@param [String] api_key for URLVoid
API @param [String] host to check @param [Hash] opts hash for additional options @return [URLVoid::Host] Response
# File lib/urlvoid/host.rb, line 15 def self.info(api_key, hostname, opts={}) identifier = opts.fetch('identifier', 'api1000') response = RestClient.get( "#{api_uri}#{identifier}/#{api_key}/host/#{hostname}/" ) doc = Nokogiri::XML(response) new(Hash.from_xml(doc.to_s)) end
new(response)
click to toggle source
# File lib/urlvoid/host.rb, line 7 def initialize(response) @response = response['response'] end
Public Instance Methods
detections()
click to toggle source
@return [Hash] of detections
# File lib/urlvoid/host.rb, line 27 def detections response['detections'] end