Class: HookSniff::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/hooksniff/options.rb

Overview

Configuration options for the HookSniff client.

Examples:

options = HookSniff::Options.new(
  server_url: "https://custom.hooksniff.com",
  timeout: 60,
  debug: true,
  headers: { "X-Custom" => "value" }
)
client = HookSniff::HookSniff.new("token", options)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_url: nil, timeout: 30, debug: false, headers: {}, retry_schedule: [1, 2, 4]) ⇒ Options

Returns a new instance of Options.



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/hooksniff/options.rb', line 17

def initialize(
  server_url: nil,
  timeout: 30,
  debug: false,
  headers: {},
  retry_schedule: [1, 2, 4]
)
  @server_url = server_url
  @timeout = timeout
  @debug = debug
  @headers = headers || {}
  @retry_schedule = retry_schedule
end

Instance Attribute Details

#debugObject

Returns the value of attribute debug.



15
16
17
# File 'lib/hooksniff/options.rb', line 15

def debug
  @debug
end

#headersObject

Returns the value of attribute headers.



15
16
17
# File 'lib/hooksniff/options.rb', line 15

def headers
  @headers
end

#retry_scheduleObject

Returns the value of attribute retry_schedule.



15
16
17
# File 'lib/hooksniff/options.rb', line 15

def retry_schedule
  @retry_schedule
end

#server_urlObject

Returns the value of attribute server_url.



15
16
17
# File 'lib/hooksniff/options.rb', line 15

def server_url
  @server_url
end

#timeoutObject

Returns the value of attribute timeout.



15
16
17
# File 'lib/hooksniff/options.rb', line 15

def timeout
  @timeout
end