Class: Nylas::Contact

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/nylas/contact.rb

Overview

ActiveModel compliant interface for interacting with the Contacts API

Instance Attribute Summary

Attributes included from Model

#api

Instance Method Summary collapse

Methods included from Model

#create, #destroy, #execute, included, #model_class, #persisted?, #reload, #resource_path, #resources_path, #save, #save_all_attributes, #to_json, #update, #update_all_attributes

Instance Method Details

#pictureObject

to retrieve it from nylas every time.



44
45
46
47
48
49
50
51
# File 'lib/nylas/contact.rb', line 44

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