Class: SubscriptionsQueryStanza

Inherits:
IqQueryStanza show all
Defined in:
lib/stanzas/subscriptions_query_stanza.rb

Instance Method Summary (collapse)

Methods inherited from IqQueryStanza

#from, #id, #random_iq_id, #to, #to_s, #type

Constructor Details

- (SubscriptionsQueryStanza) initialize(params)



3
4
5
6
7
8
9
10
11
12
# File 'lib/stanzas/subscriptions_query_stanza.rb', line 3

def initialize(params)
  super(params.merge({:type => :get}))
  pubsub = Nokogiri::XML::Node.new("pubsub", @doc)
  pubsub["xmlns"] = "http://jabber.org/protocol/pubsub"
  @iq.add_child(pubsub)
  subscriptions = Nokogiri::XML::Node.new("subscriptions", @doc)
  subscriptions["page"] = params[:page].to_s
  subscriptions["jid"] = from.split("/").first
  pubsub.add_child(subscriptions)
end

Instance Method Details

- (Object) page



14
15
16
# File 'lib/stanzas/subscriptions_query_stanza.rb', line 14

def page
  @iq.search("subscriptions").first["page"]
end