Module: Grafeas::V1::Grafeas::Paths
Overview
Path helper methods for the Grafeas API.
Instance Method Summary collapse
-
#note_path(project:, note:) ⇒ ::String
Create a fully-qualified Note resource string.
-
#occurrence_path(project:, occurrence:) ⇒ ::String
Create a fully-qualified Occurrence resource string.
-
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
Instance Method Details
#note_path(project:, note:) ⇒ ::String
Create a fully-qualified Note resource string.
The resource will be in the following format:
projects/{project}/notes/{note}
36 37 38 39 40 |
# File 'lib/grafeas/v1/grafeas/paths.rb', line 36 def note_path project:, note: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/notes/#{note}" end |
#occurrence_path(project:, occurrence:) ⇒ ::String
Create a fully-qualified Occurrence resource string.
The resource will be in the following format:
projects/{project}/occurrences/{occurrence}
53 54 55 56 57 |
# File 'lib/grafeas/v1/grafeas/paths.rb', line 53 def occurrence_path project:, occurrence: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/occurrences/#{occurrence}" end |
#project_path(project:) ⇒ ::String
Create a fully-qualified Project resource string.
The resource will be in the following format:
projects/{project}
69 70 71 |
# File 'lib/grafeas/v1/grafeas/paths.rb', line 69 def project_path project: "projects/#{project}" end |