Class: Gherkin::Formatter::Model::Step
Instance Attribute Summary collapse
#comments, #keyword, #line, #name
Instance Method Summary
collapse
#first_non_comment_line, #initialize
Instance Attribute Details
#multiline_arg ⇒ Object
Returns the value of attribute multiline_arg.
115
116
117
|
# File 'lib/gherkin/formatter/model.rb', line 115
def multiline_arg
@multiline_arg
end
|
Instance Method Details
#arguments ⇒ Object
136
137
138
|
# File 'lib/gherkin/formatter/model.rb', line 136
def arguments
result ? result.arguments : []
end
|
#line_range ⇒ Object
117
118
119
120
121
122
123
124
125
126
|
# File 'lib/gherkin/formatter/model.rb', line 117
def line_range
range = super
case multiline_arg
when Array
range = range.first..multiline_arg[-1].line
when Model::PyString
range = range.first..multiline_arg.line_range.last
end
range
end
|
#replay(formatter) ⇒ Object
128
129
130
|
# File 'lib/gherkin/formatter/model.rb', line 128
def replay(formatter)
formatter.step(self)
end
|
#status ⇒ Object
132
133
134
|
# File 'lib/gherkin/formatter/model.rb', line 132
def status
result ? result.status : 'undefined'
end
|
#to_hash ⇒ Object
140
141
142
143
144
145
146
147
148
149
150
151
|
# File 'lib/gherkin/formatter/model.rb', line 140
def to_hash
hash = super
if Array === @multiline_arg
hash['multiline_arg'] = {
'type' => 'table',
'value' => hash['multiline_arg']
}
elsif PyString === @multiline_arg
hash['multiline_arg']['type'] = 'py_string'
end
hash
end
|