class Cucumber::Messages::TableRow

Represents the TableRow message in Cucumber's message protocol.

A row in a table

Attributes

cells[R]

Cells in the row

id[R]
location[R]

The location of the first cell in the row

Public Class Methods

from_h(hash) click to toggle source

Returns a new TableRow from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.

Cucumber::Messages::TableRow.from_h(some_hash) # => #<Cucumber::Messages::TableRow:0x... ...>
# File lib/cucumber/messages.deserializers.rb, line 395
def self.from_h(hash)
  return nil if hash.nil?

  self.new(
    location: Location.from_h(hash[:location]),
    cells: hash[:cells]&.map { |item| TableCell.from_h(item) },
    id: hash[:id],
  )
end
new( location: Location.new, cells: [], id: '' ) click to toggle source
# File lib/cucumber/messages.dtos.rb, line 739
def initialize(
  location: Location.new,
  cells: [],
  id: ''
)
  @location = location
  @cells = cells
  @id = id
end