Class: Cucumber::Messages::Hook

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: '', name: nil, source_reference: SourceReference.new, tag_expression: nil) ⇒ Hook

Returns a new instance of Hook.



803
804
805
806
807
808
809
810
811
812
813
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 803

def initialize(
  id: '',
  name: nil,
  source_reference: SourceReference.new,
  tag_expression: nil
)
  @id = id
  @name = name
  @source_reference = source_reference
  @tag_expression = tag_expression
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



795
796
797
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 795

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



797
798
799
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 797

def name
  @name
end

#source_referenceObject (readonly)

Returns the value of attribute source_reference.



799
800
801
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 799

def source_reference
  @source_reference
end

#tag_expressionObject (readonly)

Returns the value of attribute tag_expression.



801
802
803
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 801

def tag_expression
  @tag_expression
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


437
438
439
440
441
442
443
444
445
446
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 437

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

  self.new(
    id: hash[:id],
    name: hash[:name],
    source_reference: SourceReference.from_h(hash[:sourceReference]),
    tag_expression: hash[:tagExpression],
  )
end