# class GxG::Networking::XmppAgentInvitation

XMPP Classes: Review : `Blather` switchover: require ::File.expand_path(“./xmpp_client.rb”,::File.dirname(__FILE__)) ### Invitations

### Public Class Methods

new(parent=nil, invitation=nil) click to toggle source

    # File lib/gxg/net_clients.rb, line 2474
    def initialize(parent=nil, invitation=nil)
      @uuid = ::GxG::uuid_generate.to_sym
      @pending = true
      @parent = parent
      @invitation = invitation
      #
      if @invitation.is_a?(::Blather::Stanza::Presence)
          @details = {:sender => @invitation.from.to_s, :type => :association}
      else
          @details = {:sender => @invitation.from.to_s, :type => :unkown}
      end
      #
      self
    end

### Public Instance Methods

[](the_key) click to toggle source

    # File lib/gxg/net_clients.rb, line 2509
    def [](the_key)
      @details[(the_key)]
    end

accept() click to toggle source

    # File lib/gxg/net_clients.rb, line 2513
    def accept()
      if @invitation
          @parent.write(@invitation.approve!)
          @pending = false
          @parent.refresh_invitations()
          true
      else
          false
      end
    end

decline() click to toggle source

    # File lib/gxg/net_clients.rb, line 2524
    def decline()
      if @invitation
          @parent.write(@invitation.cancel!)
          @pending = false
          @parent.refresh_invitations()
          true
      else
          false
      end
    end

inspect() click to toggle source

    # File lib/gxg/net_clients.rb, line 2497
    def inspect()
      @details.inspect
    end

invitation() click to toggle source

Review : debug only

    # File lib/gxg/net_clients.rb, line 2489
    def invitation()
      @invitation
    end

keys() click to toggle source

    # File lib/gxg/net_clients.rb, line 2505
    def keys()
      @details.keys()
    end

pending?() click to toggle source

    # File lib/gxg/net_clients.rb, line 2501
    def pending?()
      @pending
    end

uuid() click to toggle source

    # File lib/gxg/net_clients.rb, line 2493
    def uuid()
      @uuid
    end