Class: Merge::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, base_url: nil, environment: Merge::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil, account_token: nil) ⇒ Merge::Client

Parameters:

  • base_url (String) (defaults to: nil)
  • environment (Merge::Environment) (defaults to: Merge::Environment::PRODUCTION)
  • max_retries (Long) (defaults to: nil)

    The number of times to retry a failed request, defaults to 2.

  • timeout_in_seconds (Long) (defaults to: nil)
  • api_key (String)
  • account_token (String) (defaults to: nil)

    Token identifying the end user.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/merge_ruby_client.rb', line 35

def initialize(api_key:, base_url: nil, environment: Merge::Environment::PRODUCTION, max_retries: nil,
               timeout_in_seconds: nil, account_token: nil)
  @request_client = Merge::RequestClient.new(
    base_url: base_url,
    environment: environment,
    max_retries: max_retries,
    timeout_in_seconds: timeout_in_seconds,
    api_key: api_key,
    account_token: 
  )
  @ats = Merge::Ats::Client.new(request_client: @request_client)
  @crm = Merge::Crm::Client.new(request_client: @request_client)
  @filestorage = Merge::Filestorage::Client.new(request_client: @request_client)
  @hris = Merge::Hris::Client.new(request_client: @request_client)
  @ticketing = Merge::Ticketing::Client.new(request_client: @request_client)
  @accounting = Merge::Accounting::Client.new(request_client: @request_client)
end

Instance Attribute Details

#accountingMerge::Accounting::Client (readonly)



26
27
28
# File 'lib/merge_ruby_client.rb', line 26

def accounting
  @accounting
end

#atsMerge::Ats::Client (readonly)

Returns:



16
17
18
# File 'lib/merge_ruby_client.rb', line 16

def ats
  @ats
end

#crmMerge::Crm::Client (readonly)

Returns:



18
19
20
# File 'lib/merge_ruby_client.rb', line 18

def crm
  @crm
end

#filestorageMerge::Filestorage::Client (readonly)



20
21
22
# File 'lib/merge_ruby_client.rb', line 20

def filestorage
  @filestorage
end

#hrisMerge::Hris::Client (readonly)

Returns:



22
23
24
# File 'lib/merge_ruby_client.rb', line 22

def hris
  @hris
end

#ticketingMerge::Ticketing::Client (readonly)



24
25
26
# File 'lib/merge_ruby_client.rb', line 24

def ticketing
  @ticketing
end