class Gitter::API::User
Model representation of the /user/*
REST endpoints in the gitter API
Attributes
Name of the user
ID (from the API
)
The relative path the the user's page in the gitter webapp
Username (minus the '@')
Public Class Methods
INTERNAL METHOD
Initialize a new Gitter::API::User
Gitter::API::Client#user
will return on of these objects, as well as some methods on Gitter::API::Room
and when instanciating a Gitter::API::Message
, so favor instanciating that way.
Parameters¶ ↑
- client (
Gitter::API::Client
) -
Configured client object
- data (Hash)
-
Initialization data
Options¶ ↑
(string keys only)
- id (String)
-
User
id - display_name (String)
-
Gitter/GitHub user real name
- username (String)
-
Gitter/GitHub username (without '@')
- url (String)
-
Path to the user on
Gitter
# File lib/gitter/api/user.rb, line 42 def initialize client, data super @id = data["id"] || data["userId"] @display_name = data["displayName"] @username = data["username"] || data["screenName"] @url = data["url"] end
Public Instance Methods
Fetch the all of the room records for a given user
Includes one on one conversations, since those are considered “rooms” as well (based on their schema)
Returns a Gitter::API::Room::Collection
# File lib/gitter/api/user.rb, line 57 def rooms data = client.get "#{api_prefix}/rooms" Room::Collection.new self, data end