Class: Vines::Stanza::Iq::PrivateStorage

Inherits:
Query show all
Defined in:
lib/vines/stanza/iq/private_storage.rb

Overview

Implements the Private Storage feature defined in XEP-0049. Clients are allowed to save arbitrary XML documents on the server, identified by element name and namespace.

Constant Summary collapse

NS =
NAMESPACES[:storage]

Constants inherited from Vines::Stanza::Iq

VALID_TYPES

Constants inherited from Vines::Stanza

MESSAGE

Instance Attribute Summary

Attributes inherited from Vines::Stanza

#stream

Instance Method Summary collapse

Methods inherited from Vines::Stanza

#broadcast, from_node, #initialize, #local?, #method_missing, register, #route, #router, #send_unavailable, #storage, #unavailable

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

#processObject



14
15
16
17
18
19
20
21
22
# File 'lib/vines/stanza/iq/private_storage.rb', line 14

def process
  unless stream.private_storage?
    raise StanzaErrors::ServiceUnavailable.new(self, 'cancel')
  end
  validate_to_address
  validate_children_size
  validate_namespaces
  get? ? retrieve_fragment : update_fragment
end