module Cucumber::Core::Gherkin::Writer::HasElements::HasElementBuilders
def element(name)
def element(name) define_method(name) do |*args, &source| factory_name = String(name).split('_').map(&:capitalize).join factory = Writer.const_get(factory_name) factory.new(slurp_comments, *args).tap do |builder| builder.instance_exec(&source) if source elements << builder end self end end
def elements(*names)
def elements(*names) names.each { |name| element(name) } end