This pull request adds the ability to create, read, and delete file attachments.
An ItemAttachment element has also been created to differentiate between the Attachments that are sent in the GetItem response, but item attachments cannot be created at this time.
During this change, I updated the core method Exchanger::Attributes#attributes= so that instead of calling write_attribute it now calls public_send on the attribute setter method. This was so that attribute overrides are respected:
FileAttachment.new(content: "File content here") # New content value is set with FileAttachment#content= and goes through Base64.encode64
This pull request adds the ability to create, read, and delete file attachments.
An ItemAttachment element has also been created to differentiate between the Attachments that are sent in the GetItem response, but item attachments cannot be created at this time.
During this change, I updated the core method
Exchanger::Attributes#attributes=
so that instead of callingwrite_attribute
it now callspublic_send
on the attribute setter method. This was so that attribute overrides are respected:This is similar to the behavior of
ActiveModel::AttributeAssignment#assign_attributes
. But please let me know if you see any problems with this.