Class: TddiumStatus::Project
- Inherits:
-
Object
- Object
- TddiumStatus::Project
- Includes:
- Comparable
- Defined in:
- lib/tddium_status/project.rb
Instance Attribute Summary collapse
-
#activity ⇒ Object
readonly
Returns the value of attribute activity.
-
#build_time ⇒ Object
readonly
Returns the value of attribute build_time.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #building? ⇒ Boolean
-
#initialize(name, url, options = {}) ⇒ Project
constructor
A new instance of Project.
- #passing? ⇒ Boolean
- #to_yaml_properties ⇒ Object
Constructor Details
#initialize(name, url, options = {}) ⇒ Project
Returns a new instance of Project.
8 9 10 11 12 13 14 15 |
# File 'lib/tddium_status/project.rb', line 8 def initialize(name, url, = {}) @name = name @url = url @status = [:status] @activity = [:activity] @build_time = [:build_time] @build_time = DateTime.parse(@build_time).to_time if @build_time.is_a?(String) end |
Instance Attribute Details
#activity ⇒ Object (readonly)
Returns the value of attribute activity.
6 7 8 |
# File 'lib/tddium_status/project.rb', line 6 def activity @activity end |
#build_time ⇒ Object (readonly)
Returns the value of attribute build_time.
6 7 8 |
# File 'lib/tddium_status/project.rb', line 6 def build_time @build_time end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/tddium_status/project.rb', line 6 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/tddium_status/project.rb', line 6 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/tddium_status/project.rb', line 6 def url @url end |
Instance Method Details
#<=>(other) ⇒ Object
29 30 31 |
# File 'lib/tddium_status/project.rb', line 29 def <=>(other) other.build_time.to_i <=> build_time.to_i end |
#building? ⇒ Boolean
25 26 27 |
# File 'lib/tddium_status/project.rb', line 25 def building? activity == 'Building' end |
#passing? ⇒ Boolean
21 22 23 |
# File 'lib/tddium_status/project.rb', line 21 def passing? status.nil? || status.strip == '' || status == 'Success' end |
#to_yaml_properties ⇒ Object
17 18 19 |
# File 'lib/tddium_status/project.rb', line 17 def to_yaml_properties [:@name, :@url, :@status, :@build_time, :@activity] end |