class Cucumber::RbSupport::Snippet::Generator

Public Class Methods

register_on(configuration) click to toggle source
# File lib/cucumber/rb_support/snippet.rb, line 8
def self.register_on(configuration)
  configuration.snippet_generators << new
end

Public Instance Methods

call(code_keyword, step_name, multiline_arg, snippet_type = :regexp) click to toggle source
# File lib/cucumber/rb_support/snippet.rb, line 12
def call(code_keyword, step_name, multiline_arg, snippet_type = :regexp)
  snippet_class = typed_snippet_class(snippet_type)
  snippet_class.new(code_keyword, step_name, multiline_arg).to_s
end
typed_snippet_class(type) click to toggle source
# File lib/cucumber/rb_support/snippet.rb, line 17
def typed_snippet_class(type)
  SNIPPET_TYPES.fetch(type || :regexp)
end