Class: Menagerie::Artifact

Inherits:
Object
  • Object
show all
Defined in:
lib/menagerie/artifact.rb

Overview

Artifacts are a stored file for a particular version of a project

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Artifact

Returns a new instance of Artifact.



9
10
11
12
13
# File 'lib/menagerie/artifact.rb', line 9

def initialize(params = {})
  @options = params
  @logger = @options[:logger] || Menagerie.get_logger
  @options[:artifact] ? create : parse
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/menagerie/artifact.rb', line 7

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



7
8
9
# File 'lib/menagerie/artifact.rb', line 7

def version
  @version
end

Instance Method Details

#pathObject



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

def path
  @path ||= "#{@options[:paths][:artifacts]}/#{@name}/#{@version}"
end