Class: Cucumber::Messages::ParameterType

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(name: '', regular_expressions: [], prefer_for_regular_expression_match: false, use_for_snippets: false, id: '') ⇒ ParameterType

Returns a new instance of ParameterType.



1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1015

def initialize(
  name: '',
  regular_expressions: [],
  prefer_for_regular_expression_match: false,
  use_for_snippets: false,
  id: ''
)
  @name = name
  @regular_expressions = regular_expressions
  @prefer_for_regular_expression_match = prefer_for_regular_expression_match
  @use_for_snippets = use_for_snippets
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



1013
1014
1015
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1013

def id
  @id
end

#nameObject (readonly)

The name is unique, so we don’t need an id.



1005
1006
1007
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1005

def name
  @name
end

#prefer_for_regular_expression_matchObject (readonly)

Returns the value of attribute prefer_for_regular_expression_match.



1009
1010
1011
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1009

def prefer_for_regular_expression_match
  @prefer_for_regular_expression_match
end

#regular_expressionsObject (readonly)

Returns the value of attribute regular_expressions.



1007
1008
1009
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1007

def regular_expressions
  @regular_expressions
end

#use_for_snippetsObject (readonly)

Returns the value of attribute use_for_snippets.



1011
1012
1013
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1011

def use_for_snippets
  @use_for_snippets
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


567
568
569
570
571
572
573
574
575
576
577
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 567

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

  self.new(
    name: hash[:name],
    regular_expressions: hash[:regularExpressions],
    prefer_for_regular_expression_match: hash[:preferForRegularExpressionMatch],
    use_for_snippets: hash[:useForSnippets],
    id: hash[:id],
  )
end