### Home Classes Methods

### In Files

- lib/xmpp4r/pubsub/helper/nodebrowser.rb

### Parent

Object

### Methods

- ::new
- #category
- #get_info
- #get_metadata
- #items
- #nodes
- #nodes_names
- #type

### Files

- CHANGELOG
- COPYING
- LICENSE
- README.rdoc
- README_ruby19.txt

### Class/Module Index

Quicksearch

- Jabber
- Jabber::ArgumentError
- Jabber::Bytestreams
- Jabber::Bytestreams::IBB
- Jabber::Bytestreams::IBBInitiator
- Jabber::Bytestreams::IBBQueueItem
- Jabber::Bytestreams::IBBTarget
- Jabber::Bytestreams::IqQueryBytestreams
- Jabber::Bytestreams::IqSi
- Jabber::Bytestreams::IqSiFile
- Jabber::Bytestreams::IqSiFileRange
- Jabber::Bytestreams::SOCKS5Bytestreams
- Jabber::Bytestreams::SOCKS5BytestreamsInitiator
- Jabber::Bytestreams::SOCKS5BytestreamsPeer
- Jabber::Bytestreams::SOCKS5BytestreamsServer
- Jabber::Bytestreams::SOCKS5BytestreamsServerStreamHost
- Jabber::Bytestreams::SOCKS5BytestreamsTarget
- Jabber::Bytestreams::SOCKS5Socket
- Jabber::Bytestreams::StreamHost
- Jabber::Bytestreams::StreamHostUsed
- Jabber::Callback
- Jabber::CallbackList
- Jabber::Caps
- Jabber::Caps::C
- Jabber::Caps::Helper
- Jabber::Client
- Jabber::ClientAuthenticationFailure
- Jabber::Command
- Jabber::Command::IqCommand
- Jabber::Command::Responder
- Jabber::Component
- Jabber::ComponentAuthenticationFailure
- Jabber::Connection
- Jabber::Connection::SSLSocketUTF8
- Jabber::Dataforms
- Jabber::Dataforms::XData
- Jabber::Dataforms::XDataField
- Jabber::Dataforms::XDataInstructions
- Jabber::Dataforms::XDataReported
- Jabber::Dataforms::XDataTitle
- Jabber::Delay
- Jabber::Delay::XDelay
- Jabber::Discovery
- Jabber::Discovery::Feature
- Jabber::Discovery::Helper
- Jabber::Discovery::Identity
- Jabber::Discovery::IqQueryDiscoInfo
- Jabber::Discovery::IqQueryDiscoItems
- Jabber::Discovery::Item
- Jabber::Discovery::Responder
- Jabber::EntityTime
- Jabber::EntityTime::IqTime
- Jabber::EntityTime::Responder
- Jabber::ErrorResponse
- Jabber::FeatureNegotiation
- Jabber::FeatureNegotiation::IqFeature
- Jabber::FileTransfer
- Jabber::FileTransfer::FileSource
- Jabber::FileTransfer::Helper
- Jabber::FileTransfer::TransferSource
- Jabber::Framework
- Jabber::Framework::Base
- Jabber::Framework::Bot
- Jabber::HTTPBinding
- Jabber::HTTPBinding::Client
- Jabber::IdGenerator
- Jabber::InvalidChatState
- Jabber::Iq
- Jabber::IqQuery
- Jabber::JID
- Jabber::JabberError
- Jabber::LastActivity
- Jabber::LastActivity::Helper
- Jabber::LastActivity::IqQueryLastActivity
- Jabber::MUC
- Jabber::MUC::IqQueryMUCAdmin
- Jabber::MUC::IqQueryMUCAdminItem
- Jabber::MUC::IqQueryMUCOwner
- Jabber::MUC::MUCBrowser
- Jabber::MUC::MUCClient
- Jabber::MUC::SimpleMUCClient
- Jabber::MUC::UserItem
- Jabber::MUC::XMUC
- Jabber::MUC::XMUCUser
- Jabber::MUC::XMUCUserInvite
- Jabber::MUC::XMUCUserItem
- Jabber::Message
- Jabber::NoNameXmlnsRegistered
- Jabber::NotConnected
- Jabber::Observable
- Jabber::Observable::Contact
- Jabber::Observable::PubSub
- Jabber::Observable::PubSub::AlreadySet
- Jabber::Observable::PubSub::NoService
- Jabber::Observable::Subscriptions
- Jabber::Presence
- Jabber::PubSub
- Jabber::PubSub::Configuration
- Jabber::PubSub::Event
- Jabber::PubSub::EventItem
- Jabber::PubSub::EventItems
- Jabber::PubSub::IqPubSub
- Jabber::PubSub::IqPubSubOwner
- Jabber::PubSub::Item
- Jabber::PubSub::Items
- Jabber::PubSub::NodeBrowser
- Jabber::PubSub::NodeConfig
- Jabber::PubSub::NodeHelper
- Jabber::PubSub::OAuthPubSubStreamHelper
- Jabber::PubSub::OAuthServiceHelper
- Jabber::PubSub::OwnerNodeConfig
- Jabber::PubSub::Publish
- Jabber::PubSub::Retract
- Jabber::PubSub::ServiceHelper
- Jabber::PubSub::Subscription
- Jabber::PubSub::SubscriptionConfig
- Jabber::PubSub::Unsubscribe
- Jabber::RPC
- Jabber::RPC::Client
- Jabber::RPC::IqQueryRPC
- Jabber::RPC::Server
- Jabber::Reliable
- Jabber::Reliable::Connection
- Jabber::Reliable::Listener
- Jabber::Roster
- Jabber::Roster::Helper
- Jabber::Roster::Helper::RosterItem
- Jabber::Roster::IqQueryRoster
- Jabber::Roster::RosterItem
- Jabber::Roster::RosterX
- Jabber::Roster::RosterXItem
- Jabber::Roster::XRoster
- Jabber::Roster::XRosterItem
- Jabber::SASL
- Jabber::SASL::Anonymous
- Jabber::SASL::Base
- Jabber::SASL::DigestMD5
- Jabber::SASL::Plain
- Jabber::SOCKS5Error
- Jabber::Semaphore
- Jabber::ServerDisconnected
- Jabber::Stream
- Jabber::Stream::ThreadBlock
- Jabber::StreamParser
- Jabber::Test
- Jabber::Test::ListenerMocker
- Jabber::UserLocation
- Jabber::UserLocation::Helper
- Jabber::UserLocation::Location
- Jabber::UserTune
- Jabber::UserTune::Helper
- Jabber::UserTune::Tune
- Jabber::Vcard
- Jabber::Vcard::Helper
- Jabber::Vcard::IqVcard
- Jabber::Version
- Jabber::Version::IqQueryVersion
- Jabber::Version::Responder
- Jabber::Version::SimpleResponder
- Jabber::X
- Jabber::XHTML
- Jabber::XHTML::Body
- Jabber::XHTML::HTML
- Jabber::XMPPElement
- Jabber::XMPPStanza
- Jabber::XParent
- REXML
- REXML::Element
- REXML::IOSource
- XMLRPC
- XMLRPC::Create
- Base64
- ObservableThing
- QObserver
- ThreadStore

No matching classes.

# Jabber::PubSub::NodeBrowser

### Public Class Methods

new(stream) click to toggle source

Initialize a new NodeBrowser new(stream,pubsubservice)

stream

Jabber::Stream

    # File lib/xmpp4r/pubsub/helper/nodebrowser.rb, line 14
    def initialize(stream)
      @stream = stream
    end

### Public Instance Methods

category(jid,node) click to toggle source

get category of node

jid

Jabber::JID

node

String

    # File lib/xmpp4r/pubsub/helper/nodebrowser.rb, line 122
    def category(jid,node)
      info = get_info(jid,node)
      return info['category']
    end

get_info(jid,node) click to toggle source

get disco info for a node

jid

Jabber::JID

node

String

return

Hash

  with possible keys type

  String

    ,category

    String],features:: [Array

      of feature, nodeinformation

      Jabber::XData

check www.xmpp.org/extensions/xep-0060.html#entity for more infos

    # File lib/xmpp4r/pubsub/helper/nodebrowser.rb, line 86
    def get_info(jid,node)
      iq = Iq.new(:get,jid)
      iq.from = @stream.jid
      discoinfo = Discovery::IqQueryDiscoInfo.new
      discoinfo.node = node
      iq.add(discoinfo)
      info = {}
      @stream.send_with_id(iq) do |answer|
        identity = answer.query.identity
        info['type'] = identity.type
        info['category'] = identity.category
        info['features'] = answer.query.features
        answer.query.each_element('x') { |x|
          info['nodeinformation'] = x
        }
      end
      info
    end

Also aliased as: get_metadata
get_metadata(jid,node) click to toggle source

this is only for a xep <-> nodebrowser.rb understanding

Alias for: get_info
items(jid,node) click to toggle source

Retrieve the items from a node Throws an ServerError when receiving `<iq type='error'/>`

jid

Jabber::JID

  Target entity (set only domain!)

node

String

return

Array

  of [Hash] with keys 'name' => [String] and 'jid' => [Jabber::JID]

    # File lib/xmpp4r/pubsub/helper/nodebrowser.rb, line 64
    def items(jid,node)
      iq = Iq.new(:get,jid)
      iq.from = @stream.jid
      discoitems = Discovery::IqQueryDiscoItems.new
      discoitems.node = node
      iq.add(discoitems)
      items = []
      err = nil
      @stream.send_with_id(iq) do |answer|
        answer.query.each_element('item') { |item|
          items.push( {'jid' => item.jid,'name' => item.iname } )
        }
      end
      items
    end

nodes(jid) click to toggle source

Retrieve the nodes Throws an ServerError when receiving `<iq type='error'/>`

jid

JID

  Target entity (set only domain!)

return

Array

  of [String] or [nil]

    # File lib/xmpp4r/pubsub/helper/nodebrowser.rb, line 24
    def nodes(jid)
      iq = Iq.new(:get,jid)
      iq.from = @stream.jid
      iq.add(Discovery::IqQueryDiscoItems.new)
      nodes = []
      @stream.send_with_id(iq) do |answer|
        answer.query.each_element('item') { |item|
          nodes.push(item.node)
        }
      end
      nodes
    end

nodes_names(jid) click to toggle source

Retrieve the nodes with names Throws a ServerError when receiving `<iq type='error'/>`

jid

Jabber::JID

  Target entity (set only domain!)

return

Array

  of [Hash] with keys 'node' => [String] and 'name' => [String] or [nil]

    # File lib/xmpp4r/pubsub/helper/nodebrowser.rb, line 43
    def nodes_names(jid)
      iq = Iq.new(:get,jid)
      iq.from = @stream.jid
      iq.add(Discovery::IqQueryDiscoItems.new)
      nodes = []
      @stream.send_with_id(iq) do |answer|
        answer.query.each_element('item') do |item|
          nodes.push( {'node' => item.node,'name' => item.iname } )
        end
      end
      nodes
    end

type(jid,node) click to toggle source

get type of node

jid

Jabber::JID

node

String

    # File lib/xmpp4r/pubsub/helper/nodebrowser.rb, line 112
    def type(jid,node)
      info = get_info(jid,node)
      return info['type']
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.