Class: UniversalGitClient::Http::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty, ResponseValidation
Defined in:
lib/universal-git-client/http/base.rb

Direct Known Subclasses

Bitbucket, BitbucketServer, Github, Gitlab

Instance Method Summary collapse

Methods included from ResponseValidation

#with_response_validation!

Constructor Details

#initialize(base_url:, download_url: nil, access_token: nil, private_token: nil) ⇒ Base

Returns a new instance of Base.



14
15
16
17
18
19
20
21
22
23
# File 'lib/universal-git-client/http/base.rb', line 14

def initialize(base_url:, download_url: nil, access_token: nil, private_token: nil)
  if access_token && private_token
    raise ArgumentError, 'access_token and private_token params are mutually exclusive'
  end

  @base_url = base_url.chomp('/')
  @download_url = download_url
  @access_token = access_token
  @private_token = private_token
end