Class: Packages::Nuget::ServiceIndexPresenter

Inherits:
Object
  • Object
show all
Includes:
API::Helpers::RelatedResourcesHelpers
Defined in:
app/presenters/packages/nuget/service_index_presenter.rb

Constant Summary collapse

SERVICE_VERSIONS =
{
  download: %w[PackageBaseAddress/3.0.0],
  search: %w[SearchQueryService SearchQueryService/3.0.0-beta SearchQueryService/3.0.0-rc],
  publish: %w[PackagePublish/2.0.0],
  metadata: %w[RegistrationsBaseUrl RegistrationsBaseUrl/3.0.0-beta RegistrationsBaseUrl/3.0.0-rc]
}.freeze
SERVICE_COMMENTS =
{
  download: 'Get package content (.nupkg).',
  search: 'Filter and search for packages by keyword.',
  publish: 'Push and delete (or unlist) packages.',
  metadata: 'Get package metadata.'
}.freeze
VERSION =
'3.0.0'.freeze

Instance Method Summary collapse

Methods included from API::Helpers::RelatedResourcesHelpers

#expose_path, #expose_url, #issues_available?, #mrs_available?

Constructor Details

#initialize(project) ⇒ ServiceIndexPresenter

Returns a new instance of ServiceIndexPresenter.


24
25
26
# File 'app/presenters/packages/nuget/service_index_presenter.rb', line 24

def initialize(project)
  @project = project
end

Instance Method Details

#resourcesObject


32
33
34
35
36
37
38
39
# File 'app/presenters/packages/nuget/service_index_presenter.rb', line 32

def resources
  [
    build_service(:download),
    build_service(:search),
    build_service(:publish),
    build_service(:metadata)
  ].flatten
end

#versionObject


28
29
30
# File 'app/presenters/packages/nuget/service_index_presenter.rb', line 28

def version
  VERSION
end