Sha256: 4d724656d54300694cdac2c809e6b6624e7d448eca8b5849cdd52260cfc5eb4f

Contents?: true

Size: 847 Bytes

Versions: 16

Compression:

Stored size: 847 Bytes

Contents

# encoding: utf-8

module Punchblock
  module Command
    class Answer < CommandNode
      register :answer, :core

      include HasHeaders

      ##
      # Create a Rayo answer command. This is equivalent to a SIP "200 OK"
      #
      # @param [Hash] options
      # @option options [Array[Header], Hash, Optional] :headers SIP headers to attach to
      #   the call. Can be either a hash of key-value pairs, or an array of
      #   Header objects.
      #
      # @return [Command::Answer] a formatted Rayo answer command
      #
      # @example
      #    Answer.new.to_xml
      #
      #    returns:
      #        <answer xmlns="urn:xmpp:rayo:1"/>
      def self.new(options = {})
        super().tap do |new_node|
          new_node.headers = options[:headers]
        end
      end
    end # Answer
  end # Command
end # Punchblock

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
punchblock-1.9.4 lib/punchblock/command/answer.rb
punchblock-1.9.3 lib/punchblock/command/answer.rb
punchblock-1.9.2 lib/punchblock/command/answer.rb
punchblock-1.9.1 lib/punchblock/command/answer.rb
punchblock-1.9.0 lib/punchblock/command/answer.rb
punchblock-1.8.2 lib/punchblock/command/answer.rb
punchblock-1.8.1 lib/punchblock/command/answer.rb
punchblock-1.8.0 lib/punchblock/command/answer.rb
punchblock-1.7.1 lib/punchblock/command/answer.rb
punchblock-1.7.0 lib/punchblock/command/answer.rb
punchblock-1.6.1 lib/punchblock/command/answer.rb
punchblock-1.6.0 lib/punchblock/command/answer.rb
punchblock-1.5.3 lib/punchblock/command/answer.rb
punchblock-1.5.2 lib/punchblock/command/answer.rb
punchblock-1.5.1 lib/punchblock/command/answer.rb
punchblock-1.5.0 lib/punchblock/command/answer.rb