Class: Emendate::Examples::Csv
- Inherits:
-
Object
- Object
- Emendate::Examples::Csv
- Defined in:
- lib/emendate/examples/csv.rb
Overview
Parses examples CSV and converts each row of that table to an Examples::Row
Instance Attribute Summary collapse
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Class Method Summary collapse
-
.rows(str, opt) ⇒ Object
even more convenient access to specific rows for testing.
Instance Method Summary collapse
-
#initialize ⇒ Csv
constructor
A new instance of Csv.
-
#retrieve_rows(str, opt) ⇒ Object
Convenience method to extract specific row(s) by test fingerprint (test_string + test_options) for testing.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
Instance Attribute Details
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
18 19 20 |
# File 'lib/emendate/examples/csv.rb', line 18 def rows @rows end |
Class Method Details
.rows(str, opt) ⇒ Object
even more convenient access to specific rows for testing
13 14 15 |
# File 'lib/emendate/examples/csv.rb', line 13 def rows(str, opt) new.retrieve_rows(str, opt) end |
Instance Method Details
#retrieve_rows(str, opt) ⇒ Object
Convenience method to extract specific row(s) by test fingerprint (test_string + test_options) for testing
29 30 31 32 |
# File 'lib/emendate/examples/csv.rb', line 29 def retrieve_rows(str, opt) rows.select { |row| row.test_string == str } .select { |row| row. == opt } end |
#to_s ⇒ Object Also known as: inspect
34 35 36 |
# File 'lib/emendate/examples/csv.rb', line 34 def to_s "#{rows.length} rows" end |