Class: Api::Clients::Mend

Inherits:
Object
  • Object
show all
Defined in:
lib/api/clients/mend.rb

Constant Summary collapse

MEND_API =
"https://saas.whitesourcesoftware.com/api/v1.4"
ORG_TOKEN =
ENV["MEND_ORG_TOKEN"]
USER_KEY =
ENV["MEND_USER_KEY"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product:, project:, gitlab_url:) ⇒ Mend

Public:

  • product: product name

  • project: project name

  • gitlab_url: gitlab project url



22
23
24
25
26
# File 'lib/api/clients/mend.rb', line 22

def initialize(product:, project:, gitlab_url:)
  @gitlab_url = gitlab_url
  @product = product
  @project = project
end

Instance Attribute Details

#gitlab_urlObject

Returns the value of attribute gitlab_url.



11
12
13
# File 'lib/api/clients/mend.rb', line 11

def gitlab_url
  @gitlab_url
end

#productObject

Returns the value of attribute product.



11
12
13
# File 'lib/api/clients/mend.rb', line 11

def product
  @product
end

#projectObject

Returns the value of attribute project.



11
12
13
# File 'lib/api/clients/mend.rb', line 11

def project
  @project
end

Instance Method Details

#project_tagsObject

Public: get project tags



34
35
36
# File 'lib/api/clients/mend.rb', line 34

def project_tags
  post_call(get_tags_body)["projectTags"].first["tags"]
end

#tag_project!Object

Public: tag the project with gitlab url



29
30
31
# File 'lib/api/clients/mend.rb', line 29

def tag_project!
  save_project_tag tag: "gitlab-url", value: gitlab_url
end