def compare_and_swap(key, opts =  {})
      fail ArgumentError, 'Second argument must be a hash' unless opts.is_a?(Hash)
      fail ArgumentError, 'You must pass prevValue' unless opts.key?(:prevValue)
      set(key, opts)
    end
def compare_and_swap(key, opts =  {})
      fail ArgumentError, 'Second argument must be a hash' unless opts.is_a?(Hash)
      fail ArgumentError, 'You must pass prevValue' unless opts.key?(:prevValue)
      set(key, opts)
    end
Set a new value for key if previous value of key is matched

 This method takes the following parameters as arguments
 * key       - whose value is going to change if previous value is matched
 * value     - new value to be set for specified key
 * prevValue - value of a key to compare with existing value of key
 * ttl       - shelf life of a key (in secsonds) (optional)