Sha256: 26fb39cc30d549affe513fe1205c876ee14d450d8e20396676f767a9dce3abca

Contents?: true

Size: 532 Bytes

Versions: 13

Compression:

Stored size: 532 Bytes

Contents

class IqQueryStanza
  
  def initialize(params =  {})
    @doc = Nokogiri::XML::Document.new
    @iq = Nokogiri::XML::Node.new("iq", @doc)
    @iq["type"] = params[:type].to_s
    @iq["to"] = Superfeedr.conf[:superfeedr_jid]
    @iq["id"] = "#{random_iq_id}"
    @iq["from"] = params[:from] if params[:from]
  end
  
  def type
    @iq["type"]
  end
  
  def to
    @iq["to"]
  end
  
  def from
    @iq["from"]
  end
  
  def id
    @iq["id"]
  end
  
  def random_iq_id
    rand(1000)
  end
  
  def to_s
    @iq.to_s
  end
  
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
superfeedr-superfeedr-ruby-0.3.0 lib/stanzas/iq_query_stanza.rb
superfeedr-superfeedr-ruby-0.3.1 lib/stanzas/iq_query_stanza.rb
superfeedr-superfeedr-ruby-0.3.2 lib/stanzas/iq_query_stanza.rb
superfeedr-superfeedr-ruby-0.3.3 lib/stanzas/iq_query_stanza.rb
superfeedr-superfeedr-ruby-0.3.4 lib/stanzas/iq_query_stanza.rb
superfeedr-superfeedr-ruby-0.3.5 lib/stanzas/iq_query_stanza.rb
superfeedr-ruby-0.5.0 lib/stanzas/iq_query_stanza.rb
superfeedr-ruby-0.4.4 lib/stanzas/iq_query_stanza.rb
radamanthus-superfeedr-ruby-0.4.3 lib/stanzas/iq_query_stanza.rb
superfeedr-ruby-0.4.3 lib/stanzas/iq_query_stanza.rb
superfeedr-ruby-0.4.2 lib/stanzas/iq_query_stanza.rb
superfeedr-ruby-0.4.1 lib/stanzas/iq_query_stanza.rb
superfeedr-ruby-0.4.0 lib/stanzas/iq_query_stanza.rb