Class: Cucumber::Messages::StepMatchArgument
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb
Overview
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.
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
-
Represents the outermost capture group of an argument.
-
-
#parameter_type_name ⇒ Object
readonly
Returns the value of attribute parameter_type_name.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new StepMatchArgument from the given hash.
Instance Method Summary collapse
-
#initialize(group: Group.new, parameter_type_name: nil) ⇒ StepMatchArgument
constructor
A new instance of StepMatchArgument.
Methods included from Message::Utils
Methods included from Message::Serialization
Methods included from Message::Deserialization
Constructor Details
#initialize(group: Group.new, parameter_type_name: nil) ⇒ StepMatchArgument
Returns a new instance of StepMatchArgument.
1550 1551 1552 1553 1554 1555 1556 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1550 def initialize( group: Group.new, parameter_type_name: nil ) @group = group @parameter_type_name = parameter_type_name end |
Instance Attribute Details
#group ⇒ Object (readonly)
*
Represents the outermost capture group of an argument. This message closely matches the
`Group` class in the `cucumber-expressions` library.
1546 1547 1548 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1546 def group @group end |
#parameter_type_name ⇒ Object (readonly)
Returns the value of attribute parameter_type_name.
1548 1549 1550 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1548 def parameter_type_name @parameter_type_name end |
Class Method Details
.from_h(hash) ⇒ Object
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... ...>
942 943 944 945 946 947 948 949 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 942 def self.from_h(hash) return nil if hash.nil? self.new( group: Group.from_h(hash[:group]), parameter_type_name: hash[:parameterTypeName], ) end |