Class: TestInfo
- Inherits:
-
Object
- Object
- TestInfo
- Defined in:
- lib/test_info.rb
Instance Attribute Summary collapse
-
#achievements ⇒ Object
readonly
Returns the value of attribute achievements.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#number_of_failed_tests ⇒ Object
Returns the value of attribute number_of_failed_tests.
-
#number_of_tests ⇒ Object
Returns the value of attribute number_of_tests.
-
#total_time ⇒ Object
Returns the value of attribute total_time.
-
#xp ⇒ Object
readonly
Returns the value of attribute xp.
Instance Method Summary collapse
- #==(o) ⇒ Object
- #addAchievement(value) ⇒ Object
-
#initialize ⇒ TestInfo
constructor
A new instance of TestInfo.
Constructor Details
#initialize ⇒ TestInfo
Returns a new instance of TestInfo.
5 6 7 8 9 10 11 12 |
# File 'lib/test_info.rb', line 5 def initialize @achievements = [] @level = 1 @xp = 0 @number_of_tests = 0 @number_of_failed_tests = 0 @total_time = 0.0 end |
Instance Attribute Details
#achievements ⇒ Object (readonly)
Returns the value of attribute achievements.
3 4 5 |
# File 'lib/test_info.rb', line 3 def achievements @achievements end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
3 4 5 |
# File 'lib/test_info.rb', line 3 def level @level end |
#number_of_failed_tests ⇒ Object
Returns the value of attribute number_of_failed_tests.
2 3 4 |
# File 'lib/test_info.rb', line 2 def number_of_failed_tests @number_of_failed_tests end |
#number_of_tests ⇒ Object
Returns the value of attribute number_of_tests.
2 3 4 |
# File 'lib/test_info.rb', line 2 def number_of_tests @number_of_tests end |
#total_time ⇒ Object
Returns the value of attribute total_time.
2 3 4 |
# File 'lib/test_info.rb', line 2 def total_time @total_time end |
#xp ⇒ Object (readonly)
Returns the value of attribute xp.
3 4 5 |
# File 'lib/test_info.rb', line 3 def xp @xp end |
Instance Method Details
#==(o) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/test_info.rb', line 23 def ==(o) o.class == self.class && o.number_of_tests == number_of_tests && o.total_time == total_time && o.number_of_failed_tests == number_of_failed_tests && o.xp == xp && o.level == level && o.achievements == achievements end |
#addAchievement(value) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/test_info.rb', line 14 def addAchievement(value) unless value && value.empty? incrimentXpAndLevel @achievements << value end nil end |