Class: Cucumber::Messages::StepDefinition

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

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(id: '', pattern: StepDefinitionPattern.new, source_reference: SourceReference.new) ⇒ StepDefinition

Returns a new instance of StepDefinition.



1435
1436
1437
1438
1439
1440
1441
1442
1443
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1435

def initialize(
  id: '',
  pattern: StepDefinitionPattern.new,
  source_reference: SourceReference.new
)
  @id = id
  @pattern = pattern
  @source_reference = source_reference
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



1429
1430
1431
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1429

def id
  @id
end

#patternObject (readonly)

Returns the value of attribute pattern.



1431
1432
1433
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1431

def pattern
  @pattern
end

#source_referenceObject (readonly)

Returns the value of attribute source_reference.



1433
1434
1435
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1433

def source_reference
  @source_reference
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


859
860
861
862
863
864
865
866
867
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 859

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

  self.new(
    id: hash[:id],
    pattern: StepDefinitionPattern.from_h(hash[:pattern]),
    source_reference: SourceReference.from_h(hash[:sourceReference]),
  )
end