Class: Vines::Stanza::Iq
- Inherits:
-
Vines::Stanza
- Object
- Vines::Stanza
- Vines::Stanza::Iq
- Defined in:
- lib/vines/stanza/iq.rb,
lib/vines/stanza/iq/auth.rb,
lib/vines/stanza/iq/ping.rb,
lib/vines/stanza/iq/error.rb,
lib/vines/stanza/iq/query.rb,
lib/vines/stanza/iq/vcard.rb,
lib/vines/stanza/iq/result.rb,
lib/vines/stanza/iq/roster.rb,
lib/vines/stanza/iq/session.rb,
lib/vines/stanza/iq/version.rb,
lib/vines/stanza/iq/register.rb,
lib/vines/stanza/iq/disco_info.rb,
lib/vines/stanza/iq/disco_items.rb,
lib/vines/stanza/iq/private_storage.rb
Defined Under Namespace
Classes: Auth, DiscoInfo, DiscoItems, Error, Ping, PrivateStorage, Query, Register, Result, Roster, Session, Vcard, Version
Constant Summary collapse
- VALID_TYPES =
%w[get set result error].freeze
Constants inherited from Vines::Stanza
Instance Attribute Summary
Attributes inherited from Vines::Stanza
Instance Method Summary collapse
Methods inherited from Vines::Stanza
#broadcast, from_node, #initialize, #local?, #local_jid?, #method_missing, register, #route, #router, #send_unavailable, #storage, #to_pubsub_domain?, #unavailable, #validate_from, #validate_to
Constructor Details
This class inherits a constructor from Vines::Stanza
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Vines::Stanza
Instance Method Details
#process ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/vines/stanza/iq.rb', line 16 def process if self['id'] && VALID_TYPES.include?(self['type']) route_iq or raise StanzaErrors::FeatureNotImplemented.new(@node, 'cancel') else raise StanzaErrors::BadRequest.new(@node, 'modify') end end |
#to_result ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/vines/stanza/iq.rb', line 24 def to_result doc = Document.new doc.create_element('iq', 'from' => validate_to || stream.domain, 'id' => self['id'], 'to' => stream.user.jid, 'type' => 'result') end |