Class: Tina4::Realtime::StorageBackend

Inherits:
Object
  • Object
show all
Defined in:
lib/tina4/realtime/storage_backend.rb

Overview

Blob store interface for the realtime "files" feature.

put writes bytes, get reads them back, url returns a directly fetchable URL when the backend supports one (else nil - serve via the app download route), delete removes, exists? checks presence.

Direct Known Subclasses

LocalStorage, S3Storage

Instance Method Summary collapse

Instance Method Details

#delete(_key) ⇒ Object

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/tina4/realtime/storage_backend.rb', line 23

def delete(_key)
  raise NotImplementedError
end

#exists?(_key) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/tina4/realtime/storage_backend.rb', line 27

def exists?(_key)
  raise NotImplementedError
end

#get(_key) ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/tina4/realtime/storage_backend.rb', line 15

def get(_key)
  raise NotImplementedError
end

#put(_key, _data, _mime = "application/octet-stream") ⇒ Object

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/tina4/realtime/storage_backend.rb', line 11

def put(_key, _data, _mime = "application/octet-stream")
  raise NotImplementedError
end

#url(_key, _ttl = 3600) ⇒ Object



19
20
21
# File 'lib/tina4/realtime/storage_backend.rb', line 19

def url(_key, _ttl = 3600)
  nil
end