Sha256: 5740c54c8f84913abd5e1bf3429061e3773ab24bbe6013dd323d544ffa4d9b6b

Contents?: true

Size: 446 Bytes

Versions: 2

Compression:

Stored size: 446 Bytes

Contents

module Daijobu
  class Client

    def initialize(casket, *schemes)
      @adapter      = Daijobu::Adapter.get(casket)
      @schemes      = Daijobu::SchemeSet.new(*schemes)
    end

    def [](key)
      parse(@adapter.get(key))
    end

    def []=(key, value)
      @adapter.set(key, unparse(value))
    end

    private

    def parse(str)
      @schemes.parse(str)
    end

    def unparse(obj)
      @schemes.unparse(obj)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sander6-daijobu-0.1.0 lib/daijobu/client.rb
sander6-daijobu-0.1.1 lib/daijobu/client.rb