Module: Huntress

Extended by:
WrAPI::Configuration, WrAPI::RespondTo
Defined in:
lib/huntress.rb,
lib/huntress/api.rb,
lib/huntress/error.rb,
lib/huntress/client.rb,
lib/huntress/version.rb,
lib/huntress/connection.rb,
lib/huntress/pagination.rb,
lib/huntress/authentication.rb

Overview

require File.expand_path(‘asset_helper’, __dir__)

Defined Under Namespace

Modules: Authentication, Connection, RequestPagination Classes: API, AuthenticationError, Client, HuntressError

Constant Summary collapse

DEFAULT_UA =

Default User-Agent header sent with API requests, including gem version information.

"Huntress Ruby API wrapper #{Huntress::VERSION}"
DEFAULT_ENDPOINT =

Default api endpoint

'https://api.huntress.io'
DEFAULT_PAGINATION =
RequestPagination::PaginationPager
DEFAULT_PAGE_SIZE =
25
VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.client(options = {}) ⇒ Huntress::Client

Returns:



22
23
24
25
26
27
28
29
# File 'lib/huntress.rb', line 22

def self.client(options = {})
  Huntress::Client.new({
    endpoint: DEFAULT_ENDPOINT,
    user_agent: DEFAULT_UA,
    page_size: DEFAULT_PAGE_SIZE,
    pagination_class: DEFAULT_PAGINATION
  }.merge(options))
end

.resetObject

Resets the Skykick configuration to default values.

This method resets the configuration values to their defaults:

  • ‘DEFAULT_UA` for the User-Agent

Examples:

Reset the Huntress configuration:

Huntress.reset


38
39
40
41
42
43
44
# File 'lib/huntress.rb', line 38

def self.reset
  super
  self.endpoint = DEFAULT_ENDPOINT
  self.user_agent = DEFAULT_UA
  self.page_size        = DEFAULT_PAGE_SIZE
  self.pagination_class = DEFAULT_PAGINATION
end