Sha256: df1a5d61dcb8fab152befcf38432882cb40dce2cd62715626d3f0692924d224d

Contents?: true

Size: 582 Bytes

Versions: 1

Compression:

Stored size: 582 Bytes

Contents

module Blather
class Stanza
class Iq

  class Query < Iq
    register :query, :query

    def self.new(type)
      elem = super
      elem.query.xmlns = self.xmlns
      elem
    end

    def inherit(node)
      query.remove!
      @query = nil
      super
    end

    def query
      @query ||= if q = find_first('query')
        q
      else
        self << q = XMPPNode.new('query')
        q
      end
    end

    def reply
      elem = super
      elem.type = :result
    end

    def reply!
      self.type = :result
      super
    end
  end #Query

end #Iq
end #Stanza
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blather-0.1 lib/blather/core/stanza/iq/query.rb