class Nylas::File

Public Instance Methods

download() click to toggle source
# File lib/file.rb, line 30
def download
  download_url = self.url('download')
  ::RestClient.get(download_url) do |response, request, result|
    Nylas.interpret_response(result, response, {:raw_response => true})
    response
  end
end
inflate(json) click to toggle source
Calls superclass method
# File lib/file.rb, line 16
def inflate(json)
  super
  content_type = json["content-type"] if json["content-type"]
end
save!() click to toggle source
# File lib/file.rb, line 21
def save!
  ::RestClient.post(url, {:file => @file}) do |response, request, result|
    json = Nylas.interpret_response(result, response, :expected_class => Object)
    json = json[0] if (json.class == Array)
    inflate(json)
  end
  self
end