Class: Forem::ProfileImage
- Inherits:
-
APIResource
- Object
- ForemObject
- APIResource
- Forem::ProfileImage
- Defined in:
- lib/forem/resources/profile_image.rb
Overview
Represents the profile image associated with a Forem user or organization.
Retrieve a user's profile image URL by their username.
Profile images are avatar graphics that appear alongside user and organization names across the Forem UI. This resource exposes a single retrieve operation that looks up the image by username (or organization slug) and returns URLs to the image at various sizes.
Constant Summary collapse
- OBJECT_NAME =
"profile_image"- RESOURCE_PATH =
"/api/profile_images"
Instance Attribute Summary
Attributes inherited from ForemObject
Class Method Summary collapse
-
.retrieve(username, opts = {}) ⇒ Forem::ProfileImage
Retrieve the profile image URLs for a user or organization.
Methods inherited from APIResource
#refresh, resource_path, #resource_url
Methods inherited from ForemObject
#==, #[], #[]=, construct_from, cursor_list, #initialize, #inspect, #method_missing, paginated_list, #respond_to_missing?, #to_hash
Methods included from APIOperations::Request
Constructor Details
This class inherits a constructor from Forem::ForemObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Forem::ForemObject
Class Method Details
.retrieve(username, opts = {}) ⇒ Forem::ProfileImage
Retrieve the profile image URLs for a user or organization.
Sends a GET request to /api/profile_images/:username.
39 40 41 42 |
# File 'lib/forem/resources/profile_image.rb', line 39 def self.retrieve(username, opts = {}) resp = request(:get, "#{resource_path}/#{CGI.escape(username)}", {}, opts) construct_from(resp.parsed_body) end |