ebeigarts / exchanger

Ruby client for Exchange Web Services
MIT License
57 stars 36 forks source link

Add File Attachments #18

Closed chadrschroeder closed 8 years ago

chadrschroeder commented 8 years ago

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 is similar to the behavior of ActiveModel::AttributeAssignment#assign_attributes. But please let me know if you see any problems with this.

ebeigarts commented 8 years ago

Thanks, released 0.1.6.