Class: Vines::Storage::Null

Inherits:
Vines::Storage show all
Defined in:
lib/vines/storage/null.rb

Overview

A storage implementation that does not persist data to any form of storage. When looking up the storage object for a domain, it’s easier to treat a missing domain with a Null storage than checking for nil.

For example, presence subscription stanzas sent to a pubsub subdomain have no storage. Rather than checking for nil storage or pubsub addresses, it’s easier to treat stanzas to pubsub domains as Null storage that never finds or saves users and their rosters.

Instance Method Summary collapse

Methods inherited from Vines::Storage

#authenticate, defer, fiber, from_name, register

Methods included from Log

#log

Instance Method Details

#find_fragment(jid, node) ⇒ Object



30
31
32
# File 'lib/vines/storage/null.rb', line 30

def find_fragment(jid, node)
  nil
end

#find_user(jid) ⇒ Object



14
15
16
# File 'lib/vines/storage/null.rb', line 14

def find_user(jid)
  nil
end

#find_vcard(jid) ⇒ Object



22
23
24
# File 'lib/vines/storage/null.rb', line 22

def find_vcard(jid)
  nil
end

#save_fragment(jid, node) ⇒ Object



34
35
36
# File 'lib/vines/storage/null.rb', line 34

def save_fragment(jid, node)
  # do nothing
end

#save_user(user) ⇒ Object



18
19
20
# File 'lib/vines/storage/null.rb', line 18

def save_user(user)
  # do nothing
end

#save_vcard(jid, card) ⇒ Object



26
27
28
# File 'lib/vines/storage/null.rb', line 26

def save_vcard(jid, card)
  # do nothing
end