class Cucumber::Messages::Suggestion
Represents the Suggestion message in Cucumber’s message protocol.
A suggested fragment of code to implement an undefined step
Attributes
A unique id for this suggestion
The ID of the ‘PickleStep` this `Suggestion` was created for.
A collection of code snippets that could implement the undefined step
Public Class Methods
Source
# File lib/cucumber/messages/suggestion.rb, line 46 def self.from_h(hash) return nil if hash.nil? new( id: hash[:id], pickle_step_id: hash[:pickleStepId], snippets: hash[:snippets]&.map { |item| Snippet.from_h(item) } ) end
Returns a new Suggestion from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.
Cucumber::Messages::Suggestion.from_h(some_hash) # => #<Cucumber::Messages::Suggestion:0x... ...>
Source
# File lib/cucumber/messages/suggestion.rb, line 28 def initialize( id: '', pickle_step_id: '', snippets: [] ) @id = id @pickle_step_id = pickle_step_id @snippets = snippets super() end
Calls superclass method