<commit_before>##
# DO NOT USE THIS API!
# This file is temporary, to help make testing Punchblock easier.
# THIS IS IMPERMANENT AND WILL DISAPPEAR
module Punchblock
  class DSL
    def initialize(connection, protocol, call, queue) # :nodoc:
      @connection, @protocol, @call, @queue = connection, protocol, call, queue
    end

    def accept # :nodoc:
      write @protocol::Accept.new
    end

    def answer # :nodoc:
      write @protocol::Answer.new
    end

    def hangup # :nodoc:
      write @protocol::Hangup.new
    end

    def reject(reason = :declined) # :nodoc:
      write @protocol::Reject.new(reason)
    end

    def redirect(dest) # :nodoc:
      write @protocol::Redirect.new(dest)
    end

    def say(string, type = :text) # :nodoc:
      write @protocol::Say.new type => string
      puts "Waiting on the queue..."
      response = @queue.pop
      # TODO: Error handling
    end

    def write(msg) # :nodoc:
      @connection.write @call, msg
    end
  end
end<commit_msg>Update DSL for options hash requirement<commit_after>##
# DO NOT USE THIS API!
# This file is temporary, to help make testing Punchblock easier.
# THIS IS IMPERMANENT AND WILL DISAPPEAR
module Punchblock
  class DSL
    def initialize(connection, protocol, call, queue) # :nodoc:
      @connection, @protocol, @call, @queue = connection, protocol, call, queue
    end

    def accept # :nodoc:
      write @protocol::Accept.new
    end

    def answer # :nodoc:
      write @protocol::Answer.new
    end

    def hangup # :nodoc:
      write @protocol::Hangup.new
    end

    def reject(reason = nil) # :nodoc:
      write @protocol::Reject.new(:reason => reason)
    end

    def redirect(dest) # :nodoc:
      write @protocol::Redirect.new(:to => dest)
    end

    def say(string, type = :text) # :nodoc:
      write @protocol::Say.new type => string
      puts "Waiting on the queue..."
      response = @queue.pop
      # TODO: Error handling
    end

    def write(msg) # :nodoc:
      @connection.write @call, msg
    end
  end
end
{'fraction_non_alphanumeric': 0.10833333333333334, 'fraction_numerical': 0.0, 'mean_word_length': 2.710909090909091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2810109', 'n_tokens_mistral': 651, 'n_tokens_neox': 627, 'n_words': 208}