Class: Database::Backends
- Inherits:
-
Object
- Object
- Database::Backends
- Extended by:
- Forwardable
- Defined in:
- lib/database/backends.rb
Instance Method Summary collapse
- #has?(oid) ⇒ Boolean
-
#initialize(pathname) ⇒ Backends
constructor
A new instance of Backends.
- #load_info(oid) ⇒ Object
- #load_raw(oid) ⇒ Object
- #pack_path ⇒ Object
- #prefix_match(name) ⇒ Object
Constructor Details
Instance Method Details
#has?(oid) ⇒ Boolean
22 23 24 |
# File 'lib/database/backends.rb', line 22 def has?(oid) @stores.any? { |store| store.has?(oid) } end |
#load_info(oid) ⇒ Object
26 27 28 |
# File 'lib/database/backends.rb', line 26 def load_info(oid) @stores.reduce(nil) { |info, store| info || store.load_info(oid) } end |
#load_raw(oid) ⇒ Object
30 31 32 |
# File 'lib/database/backends.rb', line 30 def load_raw(oid) @stores.reduce(nil) { |raw, store| raw || store.load_raw(oid) } end |
#pack_path ⇒ Object
18 19 20 |
# File 'lib/database/backends.rb', line 18 def pack_path @pathname.join("pack") end |
#prefix_match(name) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/database/backends.rb', line 34 def prefix_match(name) oids = @stores.reduce([]) do |list, store| list + store.prefix_match(name) end oids.uniq end |