Class: Cucumber::Messages::PickleTag

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 PickleTag message in Cucumber’s message protocol.

*

A tag

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(name: '', ast_node_id: '') ⇒ PickleTag

Returns a new instance of PickleTag.



1286
1287
1288
1289
1290
1291
1292
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1286

def initialize(
  name: '',
  ast_node_id: ''
)
  @name = name
  @ast_node_id = ast_node_id
end

Instance Attribute Details

#ast_node_idObject (readonly)

Points to the AST node this was created from



1284
1285
1286
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1284

def ast_node_id
  @ast_node_id
end

#nameObject (readonly)

Returns the value of attribute name.



1279
1280
1281
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1279

def name
  @name
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


754
755
756
757
758
759
760
761
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 754

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

  self.new(
    name: hash[:name],
    ast_node_id: hash[:astNodeId],
  )
end