Class: Blather::Stream::Session

Inherits:
Features
  • Object
show all
Defined in:
lib/blather/stream/features/session.rb

Overview

:nodoc:

Constant Summary collapse

SESSION_NS =
'urn:ietf:params:xml:ns:xmpp-session'.freeze

Instance Method Summary collapse

Methods inherited from Features

#fail!, from_namespace, #next!, register, #succeed!

Constructor Details

#initialize(stream, succeed, fail) ⇒ Session

Returns a new instance of Session.



8
9
10
11
# File 'lib/blather/stream/features/session.rb', line 8

def initialize(stream, succeed, fail)
  super
  @to = @stream.jid.domain
end

Instance Method Details

#receive_data(stanza) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/blather/stream/features/session.rb', line 13

def receive_data(stanza)
  @node = stanza
  case stanza.element_name
  when 'session'  then  session
  when 'iq'       then  check_response
  else                  fail!(UnknownResponse.new(stanza))
  end
end