class YARD::CodeObjects::Cucumber::ScenarioOutline::Examples

Attributes

comments[RW]
keyword[RW]
line[RW]
name[RW]
rows[RW]
scenario[RW]
tags[RW]

Public Class Methods

new(parameters = {}) click to toggle source
# 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

Public Instance Methods

data() click to toggle source

The data of the table starts at the second row. When there is no data then return a empty string.

# File lib/yard/code_objects/cucumber/scenario_outline.rb, line 39
def data
  rows ? rows[1..-1] : ""
end
headers() click to toggle source

The first row of the rows contains the headers for the table

# File lib/yard/code_objects/cucumber/scenario_outline.rb, line 33
def headers
  rows.first
end
to_hash() click to toggle source
# 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) click to toggle source
# 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