lib/message.rb in inbox-0.9.0 vs lib/message.rb in inbox-0.10.0
- old
+ new
@@ -1,7 +1,8 @@
require 'restful_model'
require 'file'
+require 'rfc2882'
module Inbox
class Message < RestfulModel
parameter :subject
@@ -26,7 +27,17 @@
def files
@files ||= RestfulModelCollection.new(File, @_api, @namespace_id, {:message_id=>@id})
end
+ def raw
+ model = nil
+ collection = RestfulModelCollection.new(Message, @_api, @namespace_id, {:message_id=>@id})
+ RestClient.get("#{collection.url}/#{id}/rfc2822"){ |response,request,result|
+ json = Inbox.interpret_response(result, response, {:expected_class => Object})
+ model = Rfc2822.new(@_api)
+ model.inflate(json)
+ }
+ model
+ end
end
-end
\ No newline at end of file
+end