Class: Blobby::FakeSuccessStore::StoredObject

Inherits:
Object
  • Object
show all
Defined in:
lib/blobby/fake_success_store.rb

Overview

Handle to an object in the store.

Instance Method Summary collapse

Instance Method Details

#deleteObject



47
48
49
# File 'lib/blobby/fake_success_store.rb', line 47

def delete
  true
end

#exists?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/blobby/fake_success_store.rb', line 23

def exists?
  true
end

#readObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/blobby/fake_success_store.rb', line 27

def read
  image_path = Pathname(File.dirname(__FILE__)) + "placeholder.png"
  image_path.open("rb") do |io|
    if block_given?
      while (chunk = io.read(512))
        yield chunk
      end
      nil
    else
      io.read
    end
  end
rescue Errno::ENOENT
  nil
end

#write(_content) ⇒ Object



43
44
45
# File 'lib/blobby/fake_success_store.rb', line 43

def write(_content)
  nil
end