Sha256: 7d323d5977810dfe5f24faf54c85017d14e12ff1716fb2e3e342751ca456aab9

Contents?: true

Size: 507 Bytes

Versions: 3

Compression:

Stored size: 507 Bytes

Contents

# coding: utf-8

#
# Storage is the interface between multiple Backends. You can use Storage
# directly without having to worry about which Backend is in use.
#
module Boom
  module Storage

    def self.backend=(backend)
      backend = backend.capitalize
      Boom::Storage.const_get(backend)
      Boom.config.attributes['backend'] = backend.downcase
      Boom.config.save
    end

    def self.backend
      Boom::Storage.const_get(Boom.config.attributes['backend'].capitalize).new
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kaboom-0.3.3 lib/kaboom/storage.rb
kaboom-0.3.2 lib/kaboom/storage.rb
kaboom-0.3.1 lib/kaboom/storage.rb