Class: CFBundle::Storage::Base
- Inherits:
-
Object
- Object
- CFBundle::Storage::Base
- Defined in:
- lib/cfbundle/storage/base.rb
Overview
The Base class defines the methods required to access a bundle’s underlying storage.
Most of the time, you don’t need to concern youself with storages as Bundle.open and Bundle#initialize automatically detect and instantiate the appropriate storage.
Direct Known Subclasses
Instance Method Summary collapse
-
#close ⇒ void
Invoked when the storage is no longer needed.
-
#directory?(path) ⇒ Boolean
Returns whether a given directory exists within the storage.
-
#exist?(path) ⇒ Boolean
Returns whether a given path exists within the storage.
-
#file?(path) ⇒ Boolean
Returns whether a given file exists within the storage.
-
#foreach(path) ⇒ Enumerator
Returns an enumerator that enumerates the files contained in a directory.
-
#open(path) {|file| ... } ⇒ Object, IO
Opens a file for reading in the storage.
Instance Method Details
#close ⇒ void
This method returns an undefined value.
Invoked when the storage is no longer needed.
The default implementation does nothing.
66 |
# File 'lib/cfbundle/storage/base.rb', line 66 def close; end |
#directory?(path) ⇒ Boolean
Returns whether a given directory exists within the storage.
32 33 34 35 36 |
# File 'lib/cfbundle/storage/base.rb', line 32 def directory?(path) # :nocov: false # :nocov: end |
#exist?(path) ⇒ Boolean
Returns whether a given path exists within the storage.
14 15 16 17 18 |
# File 'lib/cfbundle/storage/base.rb', line 14 def exist?(path) # :nocov: false # :nocov: end |
#file?(path) ⇒ Boolean
Returns whether a given file exists within the storage.
23 24 25 26 27 |
# File 'lib/cfbundle/storage/base.rb', line 23 def file?(path) # :nocov: false # :nocov: end |
#foreach(path) ⇒ Enumerator
Returns an enumerator that enumerates the files contained in a directory.
56 57 58 59 60 |
# File 'lib/cfbundle/storage/base.rb', line 56 def foreach(path) # :nocov: raise(Errno::ENOENT, path) # :nocov: end |
#open(path) {|file| ... } ⇒ Object, IO
Opens a file for reading in the storage.
45 46 47 48 49 |
# File 'lib/cfbundle/storage/base.rb', line 45 def open(path, &block) # :nocov: raise(Errno::ENOENT, path) # :nocov: end |