Class: Cucumber::Messages::PickleTableRow

Inherits:
Message
  • Object
show all
Defined in:
lib/cucumber/messages/pickle_table_row.rb

Overview

Represents the PickleTableRow message in Cucumber’s message protocol.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Message

camelize, from_json, #to_h, #to_json

Constructor Details

#initialize(cells: []) ⇒ PickleTableRow

Returns a new instance of PickleTableRow.



13
14
15
16
17
18
# File 'lib/cucumber/messages/pickle_table_row.rb', line 13

def initialize(
  cells: []
)
  @cells = cells
  super()
end

Instance Attribute Details

#cellsObject (readonly)

Returns the value of attribute cells.



11
12
13
# File 'lib/cucumber/messages/pickle_table_row.rb', line 11

def cells
  @cells
end

Class Method Details

.from_h(hash) ⇒ Object

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

Cucumber::Messages::PickleTableRow.from_h(some_hash) # => #<Cucumber::Messages::PickleTableRow:0x... ...>


27
28
29
30
31
32
33
# File 'lib/cucumber/messages/pickle_table_row.rb', line 27

def self.from_h(hash)
  return nil if hash.nil?

  new(
    cells: hash[:cells]&.map { |item| PickleTableCell.from_h(item) }
  )
end