Class: Trocla::Stores

Inherits:
Object
  • Object
show all
Defined in:
lib/trocla/stores.rb

Overview

store management

Defined Under Namespace

Classes: Memory, Moneta, Vault

Class Method Summary collapse

Class Method Details

.[](store) ⇒ Object



5
6
7
# File 'lib/trocla/stores.rb', line 5

def [](store)
  stores[store.to_s.downcase]
end

.allObject



9
10
11
12
13
# File 'lib/trocla/stores.rb', line 9

def all
  @all ||= Dir[path '*'].collect do |store|
    File.basename(store, '.rb').downcase
  end
end

.available?(store) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/trocla/stores.rb', line 15

def available?(store)
  all.include?(store.to_s.downcase)
end