Exception: Vines::SaslError
- Defined in:
- lib/vines/error.rb
Direct Known Subclasses
Vines::SaslErrors::Aborted, Vines::SaslErrors::AccountDisabled, Vines::SaslErrors::CredentialsExpired, Vines::SaslErrors::EncryptionRequired, Vines::SaslErrors::IncorrectEncoding, Vines::SaslErrors::InvalidAuthzid, Vines::SaslErrors::InvalidMechanism, Vines::SaslErrors::MalformedRequest, Vines::SaslErrors::MechanismTooWeak, Vines::SaslErrors::NotAuthorized, Vines::SaslErrors::TemporaryAuthFailure
Constant Summary collapse
- NAMESPACE =
'urn:ietf:params:xml:ns:xmpp-sasl'.freeze
Instance Method Summary collapse
-
#initialize(text = nil) ⇒ SaslError
constructor
A new instance of SaslError.
- #to_xml ⇒ Object
Methods inherited from XmppError
Constructor Details
#initialize(text = nil) ⇒ SaslError
Returns a new instance of SaslError.
18 19 20 |
# File 'lib/vines/error.rb', line 18 def initialize(text=nil) @text = text end |
Instance Method Details
#to_xml ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/vines/error.rb', line 22 def to_xml doc = Document.new doc.create_element('failure') do |node| node.add_namespace(nil, NAMESPACE) node << doc.create_element(element_name) if @text node << doc.create_element('text') do |text| text['xml:lang'] = 'en' text.content = @text end end end.to_xml(:indent => 0).gsub(/\n/, '') end |