lib/message.rb in nylas-2.0.1 vs lib/message.rb in nylas-3.0.0
- old
+ new
@@ -1,10 +1,10 @@
require 'restful_model'
require 'file'
require 'mixins'
-module Inbox
+module Nylas
class Message < RestfulModel
parameter :subject
parameter :snippet
parameter :from
@@ -18,11 +18,11 @@
parameter :unread
parameter :starred
parameter :folder
parameter :labels
- include Inbox::ReadUnreadMethods
+ include Nylas::ReadUnreadMethods
def inflate(json)
super
@to ||= []
@cc ||= []
@@ -78,23 +78,22 @@
def files?
!@raw_json['files'].empty?
end
def raw
- model = nil
collection = RestfulModelCollection.new(Message, @_api, {:message_id=>@id})
RestClient.get("#{collection.url}/#{id}/", :accept => 'message/rfc822'){ |response,request,result|
- Inbox.interpret_http_status(result)
+ Nylas.interpret_response(result, response, {:raw_response => true})
response
}
end
def expanded
expanded_url = url(action='?view=expanded')
RestClient.get(expanded_url){ |response,request,result|
- json = Inbox.interpret_response(result, response, :expected_class => Object)
- expanded_message = Inbox::ExpandedMessage.new(@_api)
+ json = Nylas.interpret_response(result, response, :expected_class => Object)
+ expanded_message = Nylas::ExpandedMessage.new(@_api)
expanded_message.inflate(json)
expanded_message
}
end