Class: Gitlab::ImportUrl

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

Instance Method Summary collapse

Constructor Details

#initialize(url, credentials: nil) ⇒ ImportUrl

Returns a new instance of ImportUrl


3
4
5
6
# File 'lib/gitlab/import_url.rb', line 3

def initialize(url, credentials: nil)
  @url = URI.parse(URI.encode(url))
  @credentials = credentials
end

Instance Method Details

#credentialsObject


12
13
14
# File 'lib/gitlab/import_url.rb', line 12

def credentials
  @credentials ||= { user: @url.user, password: @url.password }
end

#full_urlObject


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

def full_url
  @full_url ||= generate_full_url.to_s
end

#sanitized_urlObject


8
9
10
# File 'lib/gitlab/import_url.rb', line 8

def sanitized_url
  @sanitized_url ||= safe_url.to_s
end