lib/restful_model.rb in nylas-2.0.1 vs lib/restful_model.rb in nylas-3.0.0

- old
+ new

@@ -1,12 +1,12 @@ require 'time_attr_accessor' require 'parameters' -module Inbox +module Nylas class RestfulModel - extend Inbox::TimeAttrAccessor - include Inbox::Parameters + extend Nylas::TimeAttrAccessor + include Nylas::Parameters parameter :id parameter :account_id parameter :cursor # Only used by the delta sync API time_attr_accessor :created_at @@ -15,11 +15,11 @@ def self.collection_name "#{self.to_s.downcase}s".split('::').last end def initialize(api, account_id = nil) - raise StandardError.new unless api.class <= Inbox::API + raise StandardError.new unless api.class <= Nylas::API @account_id = account_id @_api = api end def ==(comparison_object) @@ -63,19 +63,19 @@ def update(http_method, action, data = {}, params = {}) http_method = http_method.downcase ::RestClient.send(http_method, self.url(action), data.to_json, :content_type => :json, :params => params) do |response, request, result| unless http_method == 'delete' - json = Inbox.interpret_response(result, response, :expected_class => Object) + json = Nylas.interpret_response(result, response, :expected_class => Object) inflate(json) end end self end def destroy(params = {}) - ::RestClient.send('delete', self.url, :params => params) do |response, request| - Inbox.interpret_http_status(response) + ::RestClient.send('delete', self.url, :params => params) do |response, request, result| + Nylas.interpret_response(result, response, {:raw_response => true}) end end end end