Class: Mihari::Clients::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/mihari/clients/base.rb

Overview

Base class for API clients

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url, headers: {}, pagination_interval: Mihari.config.pagination_interval, timeout: nil) ⇒ Base



27
28
29
30
31
32
# File 'lib/mihari/clients/base.rb', line 27

def initialize(base_url, headers: {}, pagination_interval: Mihari.config.pagination_interval, timeout: nil)
  @base_url = base_url
  @headers = headers || {}
  @pagination_interval = pagination_interval
  @timeout = timeout
end

Instance Attribute Details

#base_urlString (readonly)



10
11
12
# File 'lib/mihari/clients/base.rb', line 10

def base_url
  @base_url
end

#headersHash (readonly)



13
14
15
# File 'lib/mihari/clients/base.rb', line 13

def headers
  @headers
end

#pagination_intervalInteger (readonly)



16
17
18
# File 'lib/mihari/clients/base.rb', line 16

def pagination_interval
  @pagination_interval
end

#timeoutInteger? (readonly)



19
20
21
# File 'lib/mihari/clients/base.rb', line 19

def timeout
  @timeout
end