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
Represents the outermost capture group of an argument. This message closely matches the ‘Group` class in the `cucumber-expressions` library.
Public Class Methods
Source
# File lib/cucumber/messages/step_match_argument.rb, line 42 def self.from_h(hash) return nil if hash.nil? new( group: Group.from_h(hash[:group]), parameter_type_name: hash[:parameterTypeName] ) end
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... ...>
Source
# File lib/cucumber/messages/step_match_argument.rb, line 26 def initialize( group: Group.new, parameter_type_name: nil ) @group = group @parameter_type_name = parameter_type_name super() end