Class: Pulsedive::API
- Inherits:
-
Object
- Object
- Pulsedive::API
- Defined in:
- lib/pulsedive/api.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #analyze ⇒ Object
- #feed ⇒ Object
- #indicator ⇒ Object
-
#initialize(api_key = ENV["PULSEDIVE_API_KEY"]) ⇒ API
constructor
A new instance of API.
- #search(params) ⇒ Object
- #threat ⇒ Object
Constructor Details
#initialize(api_key = ENV["PULSEDIVE_API_KEY"]) ⇒ API
Returns a new instance of API.
7 8 9 10 11 |
# File 'lib/pulsedive/api.rb', line 7 def initialize(api_key = ENV["PULSEDIVE_API_KEY"]) raise(ArgumentError, "'api_key' argument is required") unless api_key @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/pulsedive/api.rb', line 5 def api_key @api_key end |
Instance Method Details
#analyze ⇒ Object
25 26 27 |
# File 'lib/pulsedive/api.rb', line 25 def analyze @analyze ||= Analyze.new(api_key) end |
#feed ⇒ Object
21 22 23 |
# File 'lib/pulsedive/api.rb', line 21 def feed @feed ||= Feed.new(api_key) end |
#indicator ⇒ Object
13 14 15 |
# File 'lib/pulsedive/api.rb', line 13 def indicator @indicator ||= Indicator.new(api_key) end |