Class: YARD::CodeObjects::Cucumber::ScenarioOutline::Examples
- Inherits:
-
Object
- Object
- YARD::CodeObjects::Cucumber::ScenarioOutline::Examples
- Defined in:
- lib/yard/code_objects/cucumber/scenario_outline.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#keyword ⇒ Object
Returns the value of attribute keyword.
-
#line ⇒ Object
Returns the value of attribute line.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#scenario ⇒ Object
Returns the value of attribute scenario.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
-
#data ⇒ Object
The data of the table starts at the second row.
-
#headers ⇒ Object
The first row of the rows contains the headers for the table.
-
#initialize(parameters = {}) ⇒ Examples
constructor
A new instance of Examples.
- #to_hash ⇒ Object
- #values_for_row(row) ⇒ Object
Constructor Details
#initialize(parameters = {}) ⇒ Examples
Returns a new instance of Examples.
63 64 65 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 63 def initialize(parameters = {}) parameters.each { |key, value| send("#{key.to_sym}=", value) if respond_to? "#{key.to_sym}=" } end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
30 31 32 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 30 def comments @comments end |
#keyword ⇒ Object
Returns the value of attribute keyword.
30 31 32 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 30 def keyword @keyword end |
#line ⇒ Object
Returns the value of attribute line.
30 31 32 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 30 def line @line end |
#name ⇒ Object
Returns the value of attribute name.
30 31 32 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 30 def name @name end |
#rows ⇒ Object
Returns the value of attribute rows.
30 31 32 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 30 def rows @rows end |
#scenario ⇒ Object
Returns the value of attribute scenario.
30 31 32 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 30 def scenario @scenario end |
#tags ⇒ Object
Returns the value of attribute tags.
30 31 32 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 30 def @tags end |
Instance Method Details
#data ⇒ Object
The data of the table starts at the second row. When there is no data then return a empty string.
39 40 41 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 39 def data rows ? rows[1..-1] : "" end |
#headers ⇒ Object
The first row of the rows contains the headers for the table
33 34 35 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 33 def headers rows.first end |
#to_hash ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 53 def to_hash hash = {} rows.each_with_index do |header, index| hash[header] = rows.collect { |row| row[index] } end hash end |
#values_for_row(row) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/yard/code_objects/cucumber/scenario_outline.rb', line 43 def values_for_row(row) hash = {} headers.each_with_index do |header, index| hash[header] = data[row][index] end hash end |