Sha256: cd9ec3c873686200ebd5f2573f4a5826cc681dcb8682e32c87478adc0cdc129c

Contents?: true

Size: 397 Bytes

Versions: 4

Compression:

Stored size: 397 Bytes

Contents

module ButterCMS
  module DataStoreAdapters
    class Yaml
      def initialize(options)
        file_path = options.first

        @store = YAML::Store.new file_path
      end

      def set(key, value)
        @store.transaction do
          @store[key] = value
        end
      end

      def get(key)
        @store.transaction do
          @store[key]
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
buttercms-ruby-1.1.3 lib/buttercms/data_store_adapters/yaml.rb
buttercms-ruby-1.1.2 lib/buttercms/data_store_adapters/yaml.rb
buttercms-ruby-1.1.1 lib/buttercms/data_store_adapters/yaml.rb
buttercms-ruby-1.1.0 lib/buttercms/data_store_adapters/yaml.rb