Class: VetCI::Build
- Inherits:
-
Object
- Object
- VetCI::Build
- Defined in:
- lib/vet-ci/build.rb
Instance Attribute Summary collapse
-
#commit ⇒ Object
Returns the value of attribute commit.
-
#committer ⇒ Object
Returns the value of attribute committer.
-
#date ⇒ Object
Returns the value of attribute date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#output ⇒ Object
Returns the value of attribute output.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#project ⇒ Object
Returns the value of attribute project.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #commit_info ⇒ Object
- #dashboard_time ⇒ Object
- #friendly_time ⇒ Object
-
#initialize(attributes = {}) ⇒ Build
constructor
A new instance of Build.
- #status_class ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Build
Returns a new instance of Build.
14 15 16 17 18 |
# File 'lib/vet-ci/build.rb', line 14 def initialize(attributes = {}) attributes.each do |key, value| self.send("#{key}=", value) end end |
Instance Attribute Details
#commit ⇒ Object
Returns the value of attribute commit.
4 5 6 |
# File 'lib/vet-ci/build.rb', line 4 def commit @commit end |
#committer ⇒ Object
Returns the value of attribute committer.
4 5 6 |
# File 'lib/vet-ci/build.rb', line 4 def committer @committer end |
#date ⇒ Object
Returns the value of attribute date.
4 5 6 |
# File 'lib/vet-ci/build.rb', line 4 def date @date end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/vet-ci/build.rb', line 4 def id @id end |
#output ⇒ Object
Returns the value of attribute output.
4 5 6 |
# File 'lib/vet-ci/build.rb', line 4 def output @output end |
#payload ⇒ Object
Returns the value of attribute payload.
4 5 6 |
# File 'lib/vet-ci/build.rb', line 4 def payload @payload end |
#project ⇒ Object
Returns the value of attribute project.
4 5 6 |
# File 'lib/vet-ci/build.rb', line 4 def project @project end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/vet-ci/build.rb', line 4 def status @status end |
Instance Method Details
#commit_info ⇒ Object
20 21 22 23 |
# File 'lib/vet-ci/build.rb', line 20 def commit_info commit = self.project.repo.commit(self.commit) commit.nil? ? nil : commit.to_hash end |
#dashboard_time ⇒ Object
37 38 39 |
# File 'lib/vet-ci/build.rb', line 37 def dashboard_time self.date.strftime('%D @ %r') end |
#friendly_time ⇒ Object
33 34 35 |
# File 'lib/vet-ci/build.rb', line 33 def friendly_time self.date.strftime('%A, %B %e, %Y at %I:%M %p') end |
#status_class ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/vet-ci/build.rb', line 25 def status_class if self.status == 0 'passed' else 'failed' end end |