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