Sha256: eba97bfc24dd3e0963c052bac89962dbfafc76ae7fcb3dfcd7a4b5c17b1ee82b

Contents?: true

Size: 848 Bytes

Versions: 9

Compression:

Stored size: 848 Bytes

Contents

# encoding: utf-8

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

      include HasHeaders

      ##
      # Create an 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

9 entries across 9 versions & 1 rubygems

Version Path
punchblock-1.4.1 lib/punchblock/command/answer.rb
punchblock-1.4.0 lib/punchblock/command/answer.rb
punchblock-1.3.0 lib/punchblock/command/answer.rb
punchblock-1.2.0 lib/punchblock/command/answer.rb
punchblock-1.1.0 lib/punchblock/command/answer.rb
punchblock-1.0.0 lib/punchblock/command/answer.rb
punchblock-0.12.0 lib/punchblock/command/answer.rb
punchblock-0.11.0 lib/punchblock/command/answer.rb
punchblock-0.10.0 lib/punchblock/command/answer.rb