Class: CcTray::Project
- Inherits:
-
Object
- Object
- CcTray::Project
- Defined in:
- lib/cctray/project.rb
Instance Attribute Summary collapse
-
#activity ⇒ Object
Returns the value of attribute activity.
-
#lastBuildLabel ⇒ Object
Returns the value of attribute lastBuildLabel.
-
#name ⇒ Object
Returns the value of attribute name.
-
#status ⇒ Object
Returns the value of attribute status.
-
#time ⇒ Object
Returns the value of attribute time.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #building? ⇒ Boolean
- #failure? ⇒ Boolean
- #import(data) ⇒ Object
-
#initialize(data) ⇒ Project
constructor
A new instance of Project.
- #sleeping? ⇒ Boolean
- #success? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Project
Returns a new instance of Project.
5 6 7 |
# File 'lib/cctray/project.rb', line 5 def initialize(data) import(data) end |
Instance Attribute Details
#activity ⇒ Object
Returns the value of attribute activity.
3 4 5 |
# File 'lib/cctray/project.rb', line 3 def activity @activity end |
#lastBuildLabel ⇒ Object
Returns the value of attribute lastBuildLabel.
3 4 5 |
# File 'lib/cctray/project.rb', line 3 def lastBuildLabel @lastBuildLabel end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/cctray/project.rb', line 3 def name @name end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/cctray/project.rb', line 3 def status @status end |
#time ⇒ Object
Returns the value of attribute time.
3 4 5 |
# File 'lib/cctray/project.rb', line 3 def time @time end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/cctray/project.rb', line 3 def url @url end |
Instance Method Details
#building? ⇒ Boolean
18 19 20 |
# File 'lib/cctray/project.rb', line 18 def building? activity == 'Building' end |
#failure? ⇒ Boolean
30 31 32 |
# File 'lib/cctray/project.rb', line 30 def failure? status == 'Failure' end |
#import(data) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/cctray/project.rb', line 9 def import(data) self.name = data[:name] self.url = data[:webUrl] self.time = data[:lastBuildTime] self.status = data[:lastBuildStatus] self.lastBuildLabel = data[:lastBuildLabel] self.activity = data[:activity] end |
#sleeping? ⇒ Boolean
22 23 24 |
# File 'lib/cctray/project.rb', line 22 def sleeping? activity == 'Sleeping' end |
#success? ⇒ Boolean
26 27 28 |
# File 'lib/cctray/project.rb', line 26 def success? status == 'Success' end |