Class: Cucumber::Core::Ast::ExamplesTable::Row
Instance Attribute Summary collapse
Instance Method Summary
collapse
#attributes, #comments, #file, #file_colon_line, #line, #location, #match_locations?, #multiline_arg, #tags
#describe_to
Constructor Details
#initialize(data, number, location) ⇒ Row
Returns a new instance of Row.
52
53
54
55
56
57
|
# File 'lib/cucumber/core/ast/examples_table.rb', line 52
def initialize(data, number, location)
raise ArgumentError, data.to_s unless data.is_a?(Hash)
@data = data
@number = number
@location = location
end
|
Instance Attribute Details
#number ⇒ Object
Returns the value of attribute number.
50
51
52
|
# File 'lib/cucumber/core/ast/examples_table.rb', line 50
def number
@number
end
|
Instance Method Details
#==(other) ⇒ Object
59
60
61
62
63
64
|
# File 'lib/cucumber/core/ast/examples_table.rb', line 59
def ==(other)
return false unless other.class == self.class
other.number == number &&
other.location == location &&
other.data == data
end
|
#expand(string) ⇒ Object
70
71
72
73
74
75
76
|
# File 'lib/cucumber/core/ast/examples_table.rb', line 70
def expand(string)
result = string.dup
@data.each do |key, value|
result.gsub!("<#{key}>", value.to_s)
end
result
end
|
#inspect ⇒ Object
78
79
80
|
# File 'lib/cucumber/core/ast/examples_table.rb', line 78
def inspect
"#{self.class}: #{@data.inspect}"
end
|
#values ⇒ Object
66
67
68
|
# File 'lib/cucumber/core/ast/examples_table.rb', line 66
def values
@data.values
end
|