class Cucumber::Messages::StepMatchArgument

Represents the StepMatchArgument message in Cucumber's message protocol.

*

Represents a single argument extracted from a step match and passed to a step definition.
This is used for the following purposes:
- Construct an argument to pass to a step definition (possibly through a parameter type transform)
- Highlight the matched parameter in rich formatters such as the HTML formatter

This message closely matches the `Argument` class in the `cucumber-expressions` library.

Attributes

group[R]

*

Represents the outermost capture group of an argument. This message closely matches the
`Group` class in the `cucumber-expressions` library.
parameter_type_name[R]

Public Class Methods

from_h(hash) click to toggle source

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

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

  self.new(
    group: Group.from_h(hash[:group]),
    parameter_type_name: hash[:parameterTypeName],
  )
end
new( group: Group.new, parameter_type_name: nil ) click to toggle source
# File lib/cucumber/messages.dtos.rb, line 1601
def initialize(
  group: Group.new,
  parameter_type_name: nil
)
  @group = group
  @parameter_type_name = parameter_type_name
end