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