class Cucumber::Messages::Step

Represents the Step message in Cucumber's message protocol.

A step

Attributes

data_table[R]
doc_string[R]
id[R]

Unique ID to be able to reference the Step from PickleStep

keyword[R]
location[R]

The location of the steps' `keyword`

text[R]

Public Class Methods

from_h(hash) click to toggle source

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

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

  self.new(
    location: Location.from_h(hash[:location]),
    keyword: hash[:keyword],
    text: hash[:text],
    doc_string: DocString.from_h(hash[:docString]),
    data_table: DataTable.from_h(hash[:dataTable]),
    id: hash[:id],
  )
end
new( location: Location.new, keyword: '', text: '', doc_string: nil, data_table: nil, id: '' ) click to toggle source
# File lib/cucumber/messages.dtos.rb, line 673
def initialize(
  location: Location.new,
  keyword: '',
  text: '',
  doc_string: nil,
  data_table: nil,
  id: ''
)
  @location = location
  @keyword = keyword
  @text = text
  @doc_string = doc_string
  @data_table = data_table
  @id = id
end