Class: CucumberAnalytics::TableRow

Inherits:
Object
  • Object
show all
Includes:
Nested, Raw, Sourceable
Defined in:
lib/cucumber_analytics/table_row.rb

Overview

A class modeling a step table row.

Instance Attribute Summary collapse

Attributes included from Nested

#parent_element

Attributes included from Raw

#raw_element

Attributes included from Sourceable

#source_line

Instance Method Summary collapse

Methods included from Nested

#get_ancestor

Constructor Details

#initialize(source = nil) ⇒ TableRow

Creates a new TableRow object and, if source is provided, populates the object.



18
19
20
21
22
23
24
# File 'lib/cucumber_analytics/table_row.rb', line 18

def initialize(source = nil)
  parsed_row = process_source(source)

  @cells = []

  build_row(parsed_row) if parsed_row
end

Instance Attribute Details

#cellsObject

The cells that make up the row



13
14
15
# File 'lib/cucumber_analytics/table_row.rb', line 13

def cells
  @cells
end

Instance Method Details

#to_sObject

Returns a gherkin representation of the table row.



27
28
29
# File 'lib/cucumber_analytics/table_row.rb', line 27

def to_s
  "| #{cells.join(' | ')} |"
end