Class: Turnip::Node::Step
Overview
Note:
Step metadata generated by Gherkin
{
type: :Step,
location: { line: 10, column: 3 },
keyword: 'Step',
text: 'Step description',
argument: {}, # DocString or DataTable
}
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #argument ⇒ Object
-
#description ⇒ Object
Backward compatibility.
- #keyword ⇒ Object
- #text ⇒ Object
- #to_s ⇒ Object
Methods inherited from Base
Methods included from HasLocation
Constructor Details
This class inherits a constructor from Turnip::Node::Base
Instance Method Details
#argument ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/turnip/node/step.rb', line 34 def argument @argument ||= case when @raw.block&.is_a?(CukeModeler::DocString) doc_string(@raw.block) when @raw.block&.is_a?(CukeModeler::Table) data_table(@raw.block) end end |
#description ⇒ Object
Backward compatibility
30 31 32 |
# File 'lib/turnip/node/step.rb', line 30 def description text end |
#keyword ⇒ Object
18 19 20 21 |
# File 'lib/turnip/node/step.rb', line 18 def keyword # TODO: Do we want to keep the whitespace? @raw.keyword + ' ' end |
#text ⇒ Object
23 24 25 |
# File 'lib/turnip/node/step.rb', line 23 def text @raw.text end |
#to_s ⇒ Object
43 44 45 |
# File 'lib/turnip/node/step.rb', line 43 def to_s "#{keyword}#{text}" end |