Class: Jabber::PubSub::Subscription

Class | Jabber::PubSub::Subscription
In: | lib/xmpp4r/pubsub/children/subscription.rb
Parent: | XMPPElement

Subscription

### Methods

jid jid= need_approval? new node node= state state= subid subid= subscription

### Public Class methods

new(myjid=nil,mynode=nil,mysubid=nil,mysubscription=nil)

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 13
    13:       def initialize(myjid=nil,mynode=nil,mysubid=nil,mysubscription=nil)
    14:         super()
    15:         jid = myjid
    16:         node =  mynode
    17:         subid =  mysubid
    18:         state = mysubscription
    19:       end

### Public Instance methods

jid()

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 20
    20:       def jid
    21:         (a = attribute('jid')).nil? ? a : JID.new(a.value)
    22:       end

jid=(myjid)

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 23
    23:       def jid=(myjid)
    24:         add_attribute('jid', myjid ? myjid.to_s : nil)
    25:       end

need_approval?()

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 57
    57:       def need_approval?
    58:         state == :pending
    59:       end

node()

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 27
    27:       def node
    28:         attributes['node']
    29:       end

node=(mynode)

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 30
    30:       def node=(mynode)
    31:         attributes['node'] = mynode
    32:       end

state()

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 41
    41:       def state
    42:           # each child of event
    43:           # this should interate only one time
    44:           case attributes['subscription']
    45:               when 'none'               then return :none
    46:               when 'pending'            then return :pending
    47:               when 'subscribed'         then return :subscribed
    48:               when 'unconfigured'       then return :unconfigured
    49:               else return nil
    50:           end
    51:       end

state=(mystate)

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 52
    52:       def state=(mystate)
    53:         attributes['subscription'] = mystate
    54:       end

subid()

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 34
    34:       def subid
    35:         attributes['subid']
    36:       end

subid=(mysubid)

[Source]

        # File lib/xmpp4r/pubsub/children/subscription.rb, line 37
    37:       def subid=(mysubid)
    38:         attributes['subid'] = mysubid
    39:       end

subscription()

Alias for state

[Validate]