Class: Test
- Inherits:
-
Object
- Object
- Test
- Defined in:
- lib/test.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #==(another_test) ⇒ Object
-
#initialize(status, name) ⇒ Test
constructor
A new instance of Test.
- #passed? ⇒ Boolean
Constructor Details
#initialize(status, name) ⇒ Test
Returns a new instance of Test.
4 5 6 7 |
# File 'lib/test.rb', line 4 def initialize(status, name) @status = status @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/test.rb', line 2 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
2 3 4 |
# File 'lib/test.rb', line 2 def status @status end |
Instance Method Details
#==(another_test) ⇒ Object
13 14 15 16 17 |
# File 'lib/test.rb', line 13 def ==(another_test) fields_used_for_comparison.inject(true) do |acc, m| acc && instance_variable_get("@#{m}") == another_test.send(m) end end |
#passed? ⇒ Boolean
9 10 11 |
# File 'lib/test.rb', line 9 def passed? @status end |