26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/invoiced/estimate.rb', line 26
def attachments(params={})
response = @client.request(:get, "#{self.endpoint()}/attachments", params)
body = response[:body]
body.each do |attachment|
if !attachment.has_key?(:id)
attachment[:id] = attachment[:file][:id]
end
end
attachment = Attachment.new(@client)
attachments = Util.build_objects(attachment, body)
metadata = Invoiced::List.new(response[:headers][:link], response[:headers][:x_total_count])
return attachments, metadata
end
|