lib/censys/api.rb in censu-0.1.6 vs lib/censys/api.rb in censu-0.2.0
- old
+ new
@@ -1,21 +1,24 @@
+# frozen_string_literal: true
+
require 'censys/exceptions'
require 'censys/search'
require 'censys/report'
require 'censys/ipv4'
require 'censys/website'
require 'censys/certificate'
require 'censys/data'
+require 'censys/account'
require 'net/https'
require 'json'
module Censys
class API
VERSION = 1
- HOST = 'www.censys.io'.freeze
- URL = "https://#{HOST}/api/v#{VERSION}".freeze
+ HOST = 'www.censys.io'
+ URL = "https://#{HOST}/api/v#{VERSION}"
class Resource
def initialize(type, api)
@type = type
@api = api
@@ -183,9 +186,15 @@
when :series then Data::Series.new(response)
when :result then Data::Result.new(response)
else
Data::SeriesList.new(response)
end
+ end
+ end
+
+ def account
+ get("/account") do |response|
+ Account.new(response)
end
end
private