class Cucumber::Messages::StepDefinition
Represents the StepDefinition message in Cucumberโs message protocol.
Attributes
Public Class Methods
Source
# 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
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... ...>
Source
# 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
Calls superclass method