class Cucumber::Formatter::LegacyApi::Ast::HookResult

Public Class Methods

new(result, messages, embeddings) click to toggle source
# File lib/cucumber/formatter/legacy_api/ast.rb, line 68
def initialize(result, messages, embeddings)
  @result, @messages, @embeddings = result, messages, embeddings
  @already_accepted = false
end

Public Instance Methods

accept(formatter) click to toggle source
# File lib/cucumber/formatter/legacy_api/ast.rb, line 73
def accept(formatter)
  unless @already_accepted
    send_output_to(formatter)
    describe_exception_to(formatter)
  end
  self
end
describe_exception_to(formatter) click to toggle source
# File lib/cucumber/formatter/legacy_api/ast.rb, line 88
def describe_exception_to(formatter)
  unless @already_accepted
    @result.describe_exception_to(formatter)
    @already_accepted = true
  end
end
send_output_to(formatter) click to toggle source
# File lib/cucumber/formatter/legacy_api/ast.rb, line 81
def send_output_to(formatter)
  unless @already_accepted
    @messages.each { |message| formatter.puts(message) }
    @embeddings.each { |embedding| embedding.send_to_formatter(formatter) }
  end
end