Class: PassiveTotal::API
- Inherits:
-
Object
- Object
- PassiveTotal::API
- Defined in:
- lib/passivetotal/api.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #account ⇒ Object
- #action ⇒ Object
- #artifact ⇒ Object
- #base ⇒ Object
- #dns ⇒ Object
- #enrichment ⇒ Object
- #host ⇒ Object
-
#initialize(username: ENV["PASSIVETOTAL_USERNAME"], api_key: ENV["PASSIVETOTAL_API_KEY"]) ⇒ API
constructor
A new instance of API.
- #monitor ⇒ Object
- #project ⇒ Object
- #ssl ⇒ Object
- #tag ⇒ Object
- #tracker ⇒ Object
- #whois ⇒ Object
Constructor Details
#initialize(username: ENV["PASSIVETOTAL_USERNAME"], api_key: ENV["PASSIVETOTAL_API_KEY"]) ⇒ API
Returns a new instance of API.
8 9 10 11 12 13 14 |
# File 'lib/passivetotal/api.rb', line 8 def initialize(username: ENV["PASSIVETOTAL_USERNAME"], api_key: ENV["PASSIVETOTAL_API_KEY"]) @username = username raise ArgumentError, "No usernamme has been found or provided!" unless @username @api_key = api_key raise ArgumentError, "No api key has been found or provided!" unless @api_key end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/passivetotal/api.rb', line 6 def api_key @api_key end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'lib/passivetotal/api.rb', line 5 def username @username end |
Instance Method Details
#account ⇒ Object
16 17 18 |
# File 'lib/passivetotal/api.rb', line 16 def account @account ||= Client::Account.new(username: username, api_key: api_key) end |
#action ⇒ Object
20 21 22 |
# File 'lib/passivetotal/api.rb', line 20 def action @action ||= Client::Action.new(username: username, api_key: api_key) end |
#artifact ⇒ Object
24 25 26 |
# File 'lib/passivetotal/api.rb', line 24 def artifact @artifact ||= Client::Artifact.new(username: username, api_key: api_key) end |
#base ⇒ Object
28 29 30 |
# File 'lib/passivetotal/api.rb', line 28 def base @base ||= Client::Base.new(username: username, api_key: api_key) end |
#dns ⇒ Object
32 33 34 |
# File 'lib/passivetotal/api.rb', line 32 def dns @dns ||= Client::DNS.new(username: username, api_key: api_key) end |
#enrichment ⇒ Object
36 37 38 |
# File 'lib/passivetotal/api.rb', line 36 def enrichment @enrichment ||= Client::Enrichment.new(username: username, api_key: api_key) end |
#host ⇒ Object
40 41 42 |
# File 'lib/passivetotal/api.rb', line 40 def host @host ||= Client::Host.new(username: username, api_key: api_key) end |
#monitor ⇒ Object
44 45 46 |
# File 'lib/passivetotal/api.rb', line 44 def monitor @monitor ||= Client::Monitor.new(username: username, api_key: api_key) end |
#project ⇒ Object
48 49 50 |
# File 'lib/passivetotal/api.rb', line 48 def project @project ||= Client::Project.new(username: username, api_key: api_key) end |
#ssl ⇒ Object
52 53 54 |
# File 'lib/passivetotal/api.rb', line 52 def ssl @ssl ||= Client::SSL.new(username: username, api_key: api_key) end |
#tag ⇒ Object
56 57 58 |
# File 'lib/passivetotal/api.rb', line 56 def tag @tag ||= Client::Tag.new(username: username, api_key: api_key) end |