lib/chatrix/api/session.rb
def register(data, kind = 'user')
        response = make_request(
          :post,
          '/register',
          params: { kind: kind },
          content: data
        )

        @matrix.access_token = response['access_token']
        @refresh_token = response['refresh_token']

        response.parsed_response
      end
# Registers a new user on the homeserver.
#
# @note On a successful registration, the
#   {Matrix#access_token access_token} and `refresh_token` will be
#   updated to the values returned by the server.
#
# @param data [Hash] Registration data. Populate this with the
#   information needed to register the new user.
#
#   Refer to the official API documentation on how to populate the
#   data hash.
#
# @param kind [String] The kind of registration to make.
#   Either `'guest'` or `'user'`.
#
# @return [Hash] On success, returns a hash with information about the
#   newly registered user. An example return value is given below.
#
#   ```ruby
#   {
#     'user_id' => '@foo:bar.org',
#     'home_server' => 'https://bar.org',
#     'access_token' => 'some secret token',
#     'refresh_token' => 'refresh token here'
#   }
#   ```
Registers a new user on the homeserver.
Registers a new user on the homeserver .
def register(data, kind = 'user')
        response = make_request(
          :post,
          '/register',
          params: { kind: kind },
          content: data
        )
        @matrix.access_token = response['access_token']
        @refresh_token = response['refresh_token']
        response.parsed_response
      end
def register ( data , kind = 'user' ) response = make_request ( :post , '/register' , params : { kind : kind } , content : data ) @matrix . access_token = response [ 'access_token' ] @refresh_token = response [ 'refresh_token' ] response . parsed_response end
Registers a new user on the homeserver.
Registers a new user on the homeserver .
On success, returns a hash with information about the newly registered user. An example return value is given below.
On success returns a hash with information about the newly registered user . An example return value is given below .
Hash
data
Registration data. Populate this with the information needed to register the new user. Refer to the official API documentation on how to populate the data hash.
Registration data . Populate this with the information needed to register the new user . Refer to the official API documentation on how to populate the data hash .
kind
The kind of registration to make. Either `'guest'` or `'user'`.
The kind of registration to make . Either ` ' guest ' ` or ` ' user ' ` .
note
On a successful registration, the {Matrix#access_token access_token} and `refresh_token` will be updated to the values returned by the server.
On a successful registration the { Matrix#access_token access_token } and ` refresh_token ` will be updated to the values returned by the server .