Class: Exercise::Output::Pytest
- Inherits:
-
String
- Object
- String
- Exercise::Output::Pytest
- Defined in:
- lib/commands/exercise/output/pytest.rb
Instance Attribute Summary collapse
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
Instance Method Summary collapse
- #chomp(string) ⇒ Object
-
#initialize(string) ⇒ Pytest
constructor
A new instance of Pytest.
Constructor Details
#initialize(string) ⇒ Pytest
6 7 8 |
# File 'lib/commands/exercise/output/pytest.rb', line 6 def initialize(string) @summary = chomp(string[/(=+.*100%\])/m, 1]) end |
Instance Attribute Details
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
4 5 6 |
# File 'lib/commands/exercise/output/pytest.rb', line 4 def summary @summary end |
Instance Method Details
#chomp(string) ⇒ Object
10 11 12 |
# File 'lib/commands/exercise/output/pytest.rb', line 10 def chomp(string) string&.chomp end |