Class: YARD::CodeObjects::Lucid::ScenarioOutline::Examples

Inherits:
Object
  • Object
show all
Defined in:
lib/yard/code_objects/lucid/scenario_outline.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameters = {}) ⇒ Examples

Returns a new instance of Examples.



61
62
63
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 61

def initialize(parameters = {})
  parameters.each { |key,value| send("#{key.to_sym}=",value) if respond_to? "#{key.to_sym}=" }
end

Instance Attribute Details

#commentsObject

Returns the value of attribute comments.



28
29
30
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 28

def comments
  @comments
end

#keywordObject

Returns the value of attribute keyword.



28
29
30
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 28

def keyword
  @keyword
end

#lineObject

Returns the value of attribute line.



28
29
30
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 28

def line
  @line
end

#nameObject

Returns the value of attribute name.



28
29
30
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 28

def name
  @name
end

#rowsObject

Returns the value of attribute rows.



28
29
30
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 28

def rows
  @rows
end

Instance Method Details

#dataObject

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



37
38
39
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 37

def data
  rows ? rows[1..-1] : ""
end

#headersObject

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



31
32
33
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 31

def headers
  rows.first
end

#to_hashObject



51
52
53
54
55
56
57
58
59
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 51

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



41
42
43
44
45
46
47
48
49
# File 'lib/yard/code_objects/lucid/scenario_outline.rb', line 41

def values_for_row(row)
  hash = {}

  headers.each_with_index do |header,index|
    hash[header] = data[row][index]
  end

  hash
end