class Medium::Users
Users
class is used to interact with the Users
API endpoint of Medium
Public Class Methods
new(client)
click to toggle source
Initialize a new Medium::Users
client
@param client [#get] The network client to use while retrieving data from
the Users resource.
@return [Medium::Users] Returns a Medium::Users
instance
# File lib/medium/users.rb, line 10 def initialize(client) @client = client end
Public Instance Methods
me()
click to toggle source
Returns details of the user who has granted permission to the application.
@return [Hash] The response is a User object within a data envelope.
Example response: ``` HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "data": { "id": "123456789exampleid", "username": "kkirsche", "name": "Kevin Kirsche", "url": "https://medium.com/@kkirsche", "imageUrl": "https://images.medium.com/somewhere.png" } } ```
# File lib/medium/users.rb, line 31 def me response = @client.get 'me' Medium::Client.validate response end