Class: Shodan::API
Instance Attribute Summary collapse
- #account ⇒ Shodan::Clients::Account readonly
- #alert ⇒ Shodan::Clients::Alert readonly
- #dns ⇒ Shodan::Clients::DNS readonly
- #exploits ⇒ Shodan::Clients::Exploits readonly
- #host ⇒ Shodan::Clients::Host readonly
- #labs ⇒ Shodan::Clients::Labs readonly
- #query ⇒ Shodan::Clients::Query readonly
- #scan ⇒ Shodan::Clients::Scan readonly
- #tools ⇒ Shodan::Clients::Tools readonly
Instance Method Summary collapse
-
#initialize(key: ENV.fetch("SHODAN_API_KEY", nil)) ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize(key: ENV.fetch("SHODAN_API_KEY", nil)) ⇒ API
Returns a new instance of API.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/shodan/api.rb', line 53 def initialize(key: ENV.fetch("SHODAN_API_KEY", nil)) raise ArgumentError, "No API key has been found or provided! (setup your SHODAN_API_KEY environment varialbe)" if key.nil? @account = Clients::Account.new(key: key) @alert = Clients::Alert.new(key: key) @dns = Clients::DNS.new(key: key) @host = Clients::Host.new(key: key) @labs = Clients::Labs.new(key: key) @query = Clients::Query.new(key: key) @scan = Clients::Scan.new(key: key) @tools = Clients::Tools.new(key: key) @rest = Clients::REST.new(key: key) @exploits = Clients::Exploits.new(key: key) end |
Instance Attribute Details
#account ⇒ Shodan::Clients::Account (readonly)
48 49 50 |
# File 'lib/shodan/api.rb', line 48 def account @account end |
#alert ⇒ Shodan::Clients::Alert (readonly)
42 43 44 |
# File 'lib/shodan/api.rb', line 42 def alert @alert end |
#dns ⇒ Shodan::Clients::DNS (readonly)
33 34 35 |
# File 'lib/shodan/api.rb', line 33 def dns @dns end |
#exploits ⇒ Shodan::Clients::Exploits (readonly)
51 52 53 |
# File 'lib/shodan/api.rb', line 51 def exploits @exploits end |
#host ⇒ Shodan::Clients::Host (readonly)
27 28 29 |
# File 'lib/shodan/api.rb', line 27 def host @host end |
#labs ⇒ Shodan::Clients::Labs (readonly)
39 40 41 |
# File 'lib/shodan/api.rb', line 39 def labs @labs end |
#query ⇒ Shodan::Clients::Query (readonly)
30 31 32 |
# File 'lib/shodan/api.rb', line 30 def query @query end |
#scan ⇒ Shodan::Clients::Scan (readonly)
45 46 47 |
# File 'lib/shodan/api.rb', line 45 def scan @scan end |
#tools ⇒ Shodan::Clients::Tools (readonly)
36 37 38 |
# File 'lib/shodan/api.rb', line 36 def tools @tools end |