class Cucumber::Messages::Hook
Represents the Hook
message in Cucumber’s message protocol.
Attributes
id[R]
name[R]
source_reference[R]
tag_expression[R]
Public Class Methods
from_h(hash)
click to toggle source
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... ...>
# File lib/cucumber/messages/hook.rb, line 39 def self.from_h(hash) return nil if hash.nil? new( id: hash[:id], name: hash[:name], source_reference: SourceReference.from_h(hash[:sourceReference]), tag_expression: hash[:tagExpression] ) end
new( id: '', name: nil, source_reference: SourceReference.new, tag_expression: nil )
click to toggle source
Calls superclass method
# File lib/cucumber/messages/hook.rb, line 19 def initialize( id: '', name: nil, source_reference: SourceReference.new, tag_expression: nil ) @id = id @name = name @source_reference = source_reference @tag_expression = tag_expression super() end