Class: Cucumber::Wire::Snippet::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/wire/snippet.rb

Defined Under Namespace

Classes: MultilineArgClassName

Instance Method Summary collapse

Constructor Details

#initialize(connections) ⇒ Generator

Returns a new instance of Generator.



7
8
9
10
# File 'lib/cucumber/wire/snippet.rb', line 7

def initialize(connections)
  # This array is shared mutable state with the wire language.
  @connections = connections
end

Instance Method Details

#call(code_keyword, step_name, multiline_arg, _snippet_type) ⇒ Object



12
13
14
# File 'lib/cucumber/wire/snippet.rb', line 12

def call(code_keyword, step_name, multiline_arg, _snippet_type)
  @connections.snippets(code_keyword, step_name, MultilineArgClassName.new(multiline_arg).to_s).join("\n")
end