Class: BinaryEdge::API
- Inherits:
-
Object
- Object
- BinaryEdge::API
- Defined in:
- lib/binaryedge/api.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #data_leaks ⇒ Object
- #domains ⇒ Object
- #host ⇒ Object
- #image ⇒ Object
-
#initialize(api_key = ENV["BINARYEDGE_API_KEY"]) ⇒ API
constructor
A new instance of API.
- #risk_score ⇒ Object
- #sensors ⇒ Object
- #torrent ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize(api_key = ENV["BINARYEDGE_API_KEY"]) ⇒ API
Returns a new instance of API.
7 8 9 10 |
# File 'lib/binaryedge/api.rb', line 7 def initialize(api_key = ENV["BINARYEDGE_API_KEY"]) @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.
5 6 7 |
# File 'lib/binaryedge/api.rb', line 5 def api_key @api_key end |
Instance Method Details
#data_leaks ⇒ Object
24 25 26 |
# File 'lib/binaryedge/api.rb', line 24 def data_leaks @data_leaks ||= Client::DataLeaks.new(api_key) end |
#domains ⇒ Object
36 37 38 |
# File 'lib/binaryedge/api.rb', line 36 def domains @domains ||= Client::Domains.new(api_key) end |
#host ⇒ Object
16 17 18 |
# File 'lib/binaryedge/api.rb', line 16 def host @host ||= Client::Host.new(api_key) end |
#image ⇒ Object
20 21 22 |
# File 'lib/binaryedge/api.rb', line 20 def image @image ||= Client::Image.new(api_key) end |
#risk_score ⇒ Object
32 33 34 |
# File 'lib/binaryedge/api.rb', line 32 def risk_score @risk_score ||= Client::RiskScore.new(api_key) end |
#sensors ⇒ Object
40 41 42 |
# File 'lib/binaryedge/api.rb', line 40 def sensors @sensors ||= Client::Sensors.new(api_key) end |