Class: CloudAlign::Artifact

Inherits:
BaseEntity show all
Defined in:
lib/cloudalign/artifact.rb

Instance Attribute Summary collapse

Attributes inherited from BaseEntity

#created_at, #id, #updated_at

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseEntity

#initialize

Constructor Details

This class inherits a constructor from CloudAlign::BaseEntity

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/cloudalign/artifact.rb', line 3

def description
  @description
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/cloudalign/artifact.rb', line 3

def name
  @name
end

Class Method Details

.find_by_project(project_id) ⇒ Object



7
8
9
10
11
# File 'lib/cloudalign/artifact.rb', line 7

def find_by_project(project_id)
  Client.get_json("/projects/#{project_id}/artifacts").map do |row|
    Artifact.new(row)
  end
end

Instance Method Details

#analyze(analyzer, options = {}) ⇒ Object



15
16
17
18
# File 'lib/cloudalign/artifact.rb', line 15

def analyze(analyzer, options = {})
  options[:analyzer] = analyzer
  Client.post("/artifacts/#{@id}/analyze", options)
end

#destroyObject



20
21
22
# File 'lib/cloudalign/artifact.rb', line 20

def destroy
  Client.delete("/artifacts/#{@id}")
end