Method: Numerous#userPhoto

Defined in:
lib/numerousapp.rb

#userPhoto(imageDataOrReadable, mimeType: 'image/jpeg') ⇒ Hash

Note:

the server enforces an undocumented maximum data size. Exceeding the limit will raise a NumerousError (HTTP 413 / Too Large)

Set the user’s photo

Parameters:

  • Either a binary-data string of the image data or an object with a “read” method. The entire data stream will be read.

  • (defaults to: 'image/jpeg')

    Optional(keyword arg). Mime type.

Returns:

  • updated user representation (string-key hash)



853
854
855
856
857
# File 'lib/numerousapp.rb', line 853

def userPhoto(imageDataOrReadable, mimeType:'image/jpeg')
    api = makeAPIcontext(APIInfo[:user], :photo)
    mpart = { :f => imageDataOrReadable, :mimeType => mimeType }
    return simpleAPI(api, multipart: mpart)
end