Class: Cucumber::Messages::StepDefinitionPattern

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(source: '', type: StepDefinitionPatternType::CUCUMBER_EXPRESSION) ⇒ StepDefinitionPattern

Returns a new instance of StepDefinitionPattern.



1459
1460
1461
1462
1463
1464
1465
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1459

def initialize(
  source: '',
  type: StepDefinitionPatternType::CUCUMBER_EXPRESSION
)
  @source = source
  @type = type
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



1455
1456
1457
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1455

def source
  @source
end

#typeObject (readonly)

Returns the value of attribute type.



1457
1458
1459
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1457

def type
  @type
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


880
881
882
883
884
885
886
887
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 880

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

  self.new(
    source: hash[:source],
    type: hash[:type],
  )
end