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
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/turnip/node/step.rb', line 33 def argument return nil if @raw[:argument].nil? @argument ||= case @raw[:argument][:type] when :DocString doc_string(@raw[:argument]) when :DataTable data_table(@raw[:argument]) end end |
#description ⇒ Object
Backward compatibility
29 30 31 |
# File 'lib/turnip/node/step.rb', line 29 def description text end |
#keyword ⇒ Object
18 19 20 |
# File 'lib/turnip/node/step.rb', line 18 def keyword @raw[:keyword] end |
#text ⇒ Object
22 23 24 |
# File 'lib/turnip/node/step.rb', line 22 def text @raw[:text] end |
#to_s ⇒ Object
44 45 46 |
# File 'lib/turnip/node/step.rb', line 44 def to_s "#{keyword}#{text}" end |