Class: API::Entities::Releases::Link

Inherits:
Grape::Entity
  • Object
show all
Defined in:
lib/api/entities/releases/link.rb

Instance Method Summary collapse

Instance Method Details

#direct_asset_urlObject


14
15
16
17
18
19
20
21
# File 'lib/api/entities/releases/link.rb', line 14

def direct_asset_url
  return object.url unless object.filepath

  release = object.release
  project = release.project

  Gitlab::Routing.url_helpers.project_release_url(project, release) << object.filepath
end