Class: CucumberAnalytics::Table
- Inherits:
-
Object
- Object
- CucumberAnalytics::Table
- Includes:
- Containing, Nested, Raw
- Defined in:
- lib/cucumber_analytics/table.rb
Overview
A class modeling the table of a Step.
Instance Attribute Summary collapse
-
#contents ⇒ Object
The contents of the table.
-
#row_elements ⇒ Object
The row elements that make up the table.
Attributes included from Nested
Attributes included from Raw
Instance Method Summary collapse
-
#initialize(source = nil) ⇒ Table
constructor
Creates a new Table object and, if source is provided, populates the object.
-
#to_s ⇒ Object
Returns a gherkin representation of the table.
Methods included from Nested
Constructor Details
#initialize(source = nil) ⇒ Table
Creates a new Table object and, if source is provided, populates the object.
23 24 25 26 27 28 29 30 |
# File 'lib/cucumber_analytics/table.rb', line 23 def initialize(source = nil) @contents = [] @row_elements = [] parsed_table = process_source(source) build_table(parsed_table) if parsed_table end |
Instance Attribute Details
#contents ⇒ Object
The contents of the table
Deprecated
15 16 17 |
# File 'lib/cucumber_analytics/table.rb', line 15 def contents @contents end |
#row_elements ⇒ Object
The row elements that make up the table
18 19 20 |
# File 'lib/cucumber_analytics/table.rb', line 18 def row_elements @row_elements end |
Instance Method Details
#to_s ⇒ Object
Returns a gherkin representation of the table.
33 34 35 |
# File 'lib/cucumber_analytics/table.rb', line 33 def to_s row_elements.empty? ? '' : row_elements.collect { |row| row_output_string(row) }.join("\n") end |