Class: Cucumber::Core::Ast::ExamplesTable::Row
- Inherits:
-
Object
- Object
- Cucumber::Core::Ast::ExamplesTable::Row
- Includes:
- DescribesItself, HasLocation
- Defined in:
- lib/cucumber/core/ast/examples_table.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #expand(string) ⇒ Object
-
#initialize(data, number, location, language, comments) ⇒ Row
constructor
A new instance of Row.
- #inspect ⇒ Object
- #values ⇒ Object
Methods included from HasLocation
#all_locations, #attributes, #file, #file_colon_line, #line, #location, #multiline_arg, #tags
Methods included from DescribesItself
Constructor Details
#initialize(data, number, location, language, comments) ⇒ Row
Returns a new instance of Row.
68 69 70 71 72 73 74 75 |
# File 'lib/cucumber/core/ast/examples_table.rb', line 68 def initialize(data, number, location, language, comments) raise ArgumentError, data.to_s unless data.is_a?(Hash) @data = data @number = number @location = location @language = language @comments = comments end |
Instance Attribute Details
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
66 67 68 |
# File 'lib/cucumber/core/ast/examples_table.rb', line 66 def comments @comments end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
66 67 68 |
# File 'lib/cucumber/core/ast/examples_table.rb', line 66 def language @language end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
66 67 68 |
# File 'lib/cucumber/core/ast/examples_table.rb', line 66 def number @number end |
Instance Method Details
#==(other) ⇒ Object
77 78 79 80 81 82 |
# File 'lib/cucumber/core/ast/examples_table.rb', line 77 def ==(other) return false unless other.class == self.class other.number == number && other.location == location && other.data == data end |
#expand(string) ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/cucumber/core/ast/examples_table.rb', line 88 def (string) result = string.dup @data.each do |key, value| result.gsub!("<#{key}>", value.to_s) end result end |
#inspect ⇒ Object
96 97 98 |
# File 'lib/cucumber/core/ast/examples_table.rb', line 96 def inspect "#<#{self.class}: #{@data.inspect} (#{location})>" end |
#values ⇒ Object
84 85 86 |
# File 'lib/cucumber/core/ast/examples_table.rb', line 84 def values @data.values end |