Exception: Vines::StreamError
- Defined in:
- lib/vines/error.rb
Direct Known Subclasses
Vines::StreamErrors::BadFormat, Vines::StreamErrors::BadNamespacePrefix, Vines::StreamErrors::Conflict, Vines::StreamErrors::ConnectionTimeout, Vines::StreamErrors::HostGone, Vines::StreamErrors::HostUnknown, Vines::StreamErrors::ImproperAddressing, Vines::StreamErrors::InternalServerError, Vines::StreamErrors::InvalidFrom, Vines::StreamErrors::InvalidNamespace, Vines::StreamErrors::InvalidXml, Vines::StreamErrors::NotAuthorized, Vines::StreamErrors::NotWellFormed, Vines::StreamErrors::PolicyViolation, Vines::StreamErrors::RemoteConnectionFailed, Vines::StreamErrors::Reset, Vines::StreamErrors::ResourceConstraint, Vines::StreamErrors::RestrictedXml, Vines::StreamErrors::SeeOtherHost, Vines::StreamErrors::SystemShutdown, Vines::StreamErrors::UndefinedCondition, Vines::StreamErrors::UnsupportedEncoding, Vines::StreamErrors::UnsupportedFeature, Vines::StreamErrors::UnsupportedStanzaType, Vines::StreamErrors::UnsupportedVersion
Constant Summary collapse
- NAMESPACE =
'urn:ietf:params:xml:ns:xmpp-streams'.freeze
Instance Method Summary collapse
-
#initialize(text = nil) ⇒ StreamError
constructor
A new instance of StreamError.
- #to_xml ⇒ Object
Methods inherited from XmppError
Constructor Details
#initialize(text = nil) ⇒ StreamError
Returns a new instance of StreamError.
40 41 42 |
# File 'lib/vines/error.rb', line 40 def initialize(text=nil) @text = text end |
Instance Method Details
#to_xml ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/vines/error.rb', line 44 def to_xml doc = Document.new doc.create_element('stream:error') do |el| el << doc.create_element(element_name, 'xmlns' => NAMESPACE) if @text el << doc.create_element('text', @text, 'xmlns' => NAMESPACE, 'xml:lang' => 'en') end end.to_xml(:indent => 0).gsub(/\n/, '') end |