Module: MixinBot::API::Me
- Included in:
- MixinBot::API
- Defined in:
- lib/mixin_bot/api/me.rb
Instance Method Summary collapse
- #friends(access_token: nil) ⇒ Object (also: #read_friends)
- #me(access_token: nil) ⇒ Object (also: #read_me)
-
#update_me(full_name:, avatar_base64: nil, access_token: nil) ⇒ Object
developers.mixin.one/api/beta-mixin-message/update-profile/ avatar_base64: String: Base64 of image, supports format png, jpeg and gif, base64 image size > 1024.
Instance Method Details
#friends(access_token: nil) ⇒ Object Also known as: read_friends
30 31 32 33 34 35 |
# File 'lib/mixin_bot/api/me.rb', line 30 def friends(access_token: nil) path = '/friends' access_token ||= access_token('GET', path, '') = format('Bearer %<access_token>s', access_token: access_token) client.get(path, headers: { 'Authorization': }) end |
#me(access_token: nil) ⇒ Object Also known as: read_me
7 8 9 10 11 12 |
# File 'lib/mixin_bot/api/me.rb', line 7 def me(access_token: nil) path = '/me' access_token ||= access_token('GET', path, '') = format('Bearer %<access_token>s', access_token: access_token) client.get(path, headers: { 'Authorization': }) end |
#update_me(full_name:, avatar_base64: nil, access_token: nil) ⇒ Object
developers.mixin.one/api/beta-mixin-message/update-profile/ avatar_base64: String: Base64 of image, supports format png, jpeg and gif, base64 image size > 1024.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/mixin_bot/api/me.rb', line 18 def update_me(full_name:, avatar_base64: nil, access_token: nil) path = '/me' payload = { full_name: full_name, avatar_base64: avatar_base64 } access_token ||= access_token('POST', path, payload.to_json) = format('Bearer %<access_token>s', access_token: access_token) client.post(path, headers: { 'Authorization': }, json: payload) end |