lib/nylas/contact.rb in nylas-4.2.4 vs lib/nylas/contact.rb in nylas-4.3.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Nylas
# ActiveModel compliant interface for interacting with the Contacts API
# @see https://docs.nylas.com/reference#contacts
class Contact
include Model
@@ -38,9 +40,10 @@
# @returns [Tempfile] path to the retrieved picture. It is preferrable to cache this in your system than
# to retrieve it from nylas every time.
def picture
return @picture_tempfile if @picture_tempfile
+
@picture_tempfile = Tempfile.new
@picture_tempfile.write(api.get(path: "#{resource_path}/picture"))
@picture_tempfile.close
@picture_tempfile
end