Class: Turnip::Node::Example
- Includes:
- HasTags
- Defined in:
- lib/turnip/node/example.rb
Overview
Note:
Example metadata generated by Gherkin
{
type: :Examples,
tags: [], # Array of Tag
location: { line: 10, column: 3 },
keyword: "Examples",
name: "Example Description",
tableHeader: {},
tableBody: {}
}
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods included from HasTags
#metadata_hash, #tag_names, #tags
Methods inherited from Base
Methods included from HasLocation
Constructor Details
This class inherits a constructor from Turnip::Node::Base
Instance Method Details
#description ⇒ Object
30 31 32 |
# File 'lib/turnip/node/example.rb', line 30 def description @raw.description end |
#header ⇒ Array
Note:
Examples: | monster | hp | | slime | 10 | => [ ‘monster’, ‘hp’ ] | daemon | 70 |
44 45 46 |
# File 'lib/turnip/node/example.rb', line 44 def header @header ||= @raw.parameter_row.cells.map { |c| c.value } end |
#keyword ⇒ Object
22 23 24 |
# File 'lib/turnip/node/example.rb', line 22 def keyword @raw.keyword end |
#name ⇒ Object
26 27 28 |
# File 'lib/turnip/node/example.rb', line 26 def name @raw.name end |
#rows ⇒ Array
Note:
Examples: | monster | hp | | slime | 10 | => [ [‘slime’, ‘10’], [‘daemon’, ‘70’] ] | daemon | 70 |
58 59 60 61 62 |
# File 'lib/turnip/node/example.rb', line 58 def rows @rows ||= @raw.argument_rows.map do |row| row.cells.map { |c| c.value } end end |