File: avatar.rb

package info (click to toggle)
ruby-gitlab 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,660 kB
  • sloc: ruby: 12,582; makefile: 7; sh: 4
file content (21 lines) | stat: -rw-r--r-- 813 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

class Gitlab::Client
  # Defines methods related to avatar.
  # @see https://docs.gitlab.com/ce/api/avatar.html
  module Avatar
    # Get a single avatar URL for a user with the given email address.
    #
    # @example
    #   Gitlab.avatar(email: 'admin@example.com')
    #   Gitlab.avatar(email: 'admin@example.com', size: 32)
    #
    # @param  [Hash] options A customizable set of options.
    # @option options [String] :email(required) Public email address of the user.
    # @option options [Integer] :size(optional) Single pixel dimension (since images are squares). Only used for avatar lookups at Gravatar or at the configured Libravatar server.
    # @return <Gitlab::ObjectifiedHash>
    def avatar(options = {})
      get('/avatar', query: options)
    end
  end
end