class Cucumber::Core::Gherkin::Writer::Gherkin

Public Class Methods

new(uri, &source) click to toggle source
# File lib/cucumber/core/gherkin/writer.rb, line 18
def initialize(uri, &source)
  @uri, @source = uri, source
end

Public Instance Methods

build() click to toggle source
# File lib/cucumber/core/gherkin/writer.rb, line 37
def build
  instance_exec(&@source)
  Document.new(@uri, @feature.build.join("\n"))
end
comment(line) click to toggle source
# File lib/cucumber/core/gherkin/writer.rb, line 22
def comment(line)
  comment_lines << "# #{line}"
end
comment_lines() click to toggle source
# File lib/cucumber/core/gherkin/writer.rb, line 26
def comment_lines
  @comment_lines ||= []
end
feature(*args, &source) click to toggle source
# File lib/cucumber/core/gherkin/writer.rb, line 30
def feature(*args, &source)
  @feature = Feature.new(comment_lines, *args).tap do |builder|
    builder.instance_exec(&source) if source
  end
  self
end