module Splash::Backends
generic backends module
generic backends module
generic backends module
Public Instance Methods
get_backend(store)
click to toggle source
factory for backend @param [Symbol] store the name of the store actually in [:execution_trace] @return [Splash::Backends::<Type>|Hash] with type in [:redis,:file] or Exiter
case :configuration_error
# File lib/splash/backends.rb, line 15 def get_backend(store) splash_exit case: :configuration_error, more: "backend definition failure" if get_config[:backends][:stores][store].nil? backend = get_config[:backends][:stores][store][:type].to_s aclass = "Splash::Backends::#{backend.capitalize}" begin return Kernel.const_get(aclass)::new(store) rescue splash_exit case: :configuration_error, more: "Backend specified for store #{store} inexistant : #{backend}" end end
list_backends()
click to toggle source
return list of configured backand @return [Hash] the backends hash list/structure
# File lib/splash/backends.rb, line 28 def list_backends return get_config[:backends][:stores] end