Class: Cucumber::Messages::PickleStep

Inherits:
Message show all
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 PickleStep message in Cucumber’s message protocol.

*

An executable step

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Message::Utils

included

Methods included from Message::Serialization

#to_h, #to_json

Methods included from Message::Deserialization

included

Constructor Details

#initialize(argument: nil, ast_node_ids: [], id: '', text: '') ⇒ PickleStep

Returns a new instance of PickleStep.



1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1180

def initialize(
  argument: nil,
  ast_node_ids: [],
  id: '',
  text: ''
)
  @argument = argument
  @ast_node_ids = ast_node_ids
  @id = id
  @text = text
end

Instance Attribute Details

#argumentObject (readonly)

Returns the value of attribute argument.



1165
1166
1167
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1165

def argument
  @argument
end

#ast_node_idsObject (readonly)

References the IDs of the source of the step. For Gherkin, this can be

the ID of a Step, and possibly also the ID of a TableRow


1171
1172
1173
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1171

def ast_node_ids
  @ast_node_ids
end

#idObject (readonly)

A unique ID for the PickleStep



1176
1177
1178
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1176

def id
  @id
end

#textObject (readonly)

Returns the value of attribute text.



1178
1179
1180
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1178

def text
  @text
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


655
656
657
658
659
660
661
662
663
664
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 655

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

  self.new(
    argument: PickleStepArgument.from_h(hash[:argument]),
    ast_node_ids: hash[:astNodeIds],
    id: hash[:id],
    text: hash[:text],
  )
end