Class: Buildbox::Artifact
- Inherits:
-
Object
- Object
- Buildbox::Artifact
- Defined in:
- lib/buildbox/artifact.rb
Defined Under Namespace
Classes: Collector, Poster, Uploader
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#remote_id ⇒ Object
Returns the value of attribute remote_id.
-
#upload_instructions ⇒ Object
Returns the value of attribute upload_instructions.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json ⇒ Object
- #basename ⇒ Object
-
#initialize(id, glob_path, name, path, original_path) ⇒ Artifact
constructor
A new instance of Artifact.
Constructor Details
#initialize(id, glob_path, name, path, original_path) ⇒ Artifact
Returns a new instance of Artifact.
16 17 18 19 20 21 22 |
# File 'lib/buildbox/artifact.rb', line 16 def initialize(id, glob_path, name, path, original_path) @id = id @glob_path = glob_path @name = name @path = path @original_path = original_path end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/buildbox/artifact.rb', line 9 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/buildbox/artifact.rb', line 9 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/buildbox/artifact.rb', line 9 def path @path end |
#remote_id ⇒ Object
Returns the value of attribute remote_id.
10 11 12 |
# File 'lib/buildbox/artifact.rb', line 10 def remote_id @remote_id end |
#upload_instructions ⇒ Object
Returns the value of attribute upload_instructions.
10 11 12 |
# File 'lib/buildbox/artifact.rb', line 10 def upload_instructions @upload_instructions end |
Class Method Details
.create(glob_path, name, path, original_path) ⇒ Object
12 13 14 |
# File 'lib/buildbox/artifact.rb', line 12 def self.create(glob_path, name, path, original_path) new(SecureRandom.uuid, glob_path, name, path, original_path) end |
Instance Method Details
#as_json ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/buildbox/artifact.rb', line 28 def as_json { :id => @id, :glob_path => @glob_path, :name => @name, :path => @path, :original_path => @original_path, :file_size => File.size(@path) } end |
#basename ⇒ Object
24 25 26 |
# File 'lib/buildbox/artifact.rb', line 24 def basename File.basename(@path) end |