Sha256: e83a2e606633453c91887574587b48e5cfcacfecfc485b6bb1b97cf102043a6f

Contents?: true

Size: 588 Bytes

Versions: 2

Compression:

Stored size: 588 Bytes

Contents

# frozen_string_literal: true

module Pulsedive
  class API
    attr_reader :api_key

    def initialize(api_key = ENV["PULSEDIVE_API_KEY"])
      raise(ArgumentError, "'api_key' argument is required") unless api_key

      @api_key = api_key
    end

    def indicator
      @indicator ||= Indicator.new(api_key)
    end

    def threat
      @threat ||= Threat.new(api_key)
    end

    def feed
      @feed ||= Feed.new(api_key)
    end

    def analyze
      @analyze ||= Analyze.new(api_key)
    end

    def search(params)
      Search.new(api_key).search(params)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pulsedive-0.1.5 lib/pulsedive/api.rb
pulsedive-0.1.4 lib/pulsedive/api.rb