Dirty object-based approach

Contrasting with #3, this approach is more efficient as it requires only a single call to add/update/delete metadata for a single container.

The dirty object idiom diverges from the existing idioms.  However, Looking at the API docs for CloudFiles objects, I suspect that a similar idiom will be desirable for Object metadata and perhaps content as well.
Actually it may be in 1.8.7. Object#tap started there. Still, don't care. ;-)

On Fri, Jul 18, 2014 at 8:37 AM, Ash Wilson <notifications@github.com>
wrote:

>> +      end
>> +
>> +      def [](k)
>> +        @fields[k]
>> +      end
>> +
>> +      def [](k, v)
>> +        @dirty = true
>> +        @new_fields[k] = v
>> +      end
>> +
>> +      def save!
>> +        fields_added   = @new_fields.keys - @fields.keys
>> +        fields_removed = @fields.keys - @new_fields.keys
>> +
>> +        headers = fields_added.each_with_object({}) { |f, h|
> :thumbsup: 
> Yes. Yes, thank you. :bow:
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/elight/redrax/pull/4/files#r15108265