Module: Mattermost::Endpoint::Emoji
- Included in:
- Mattermost::Endpoint
- Defined in:
- lib/mattermost/endpoint/emoji.rb
Instance Method Summary collapse
- #create_custom_emoji(image_file, emoji) ⇒ Object
- #delete_custom_emoji(emoji_id) ⇒ Object
- #get_custom_emoji(emoji_id) ⇒ Object
- #get_custom_emoji_image(emoji_id, file_name) ⇒ Object
- #get_custom_emoji_image_url(emoji_id) ⇒ Object
- #get_custom_emoji_list(max = 60) ⇒ Object
Instance Method Details
#create_custom_emoji(image_file, emoji) ⇒ Object
7 8 9 10 |
# File 'lib/mattermost/endpoint/emoji.rb', line 7 def create_custom_emoji(image_file, emoji) #post("/emoji", emoji.to_json) raise NotImplementedError end |
#delete_custom_emoji(emoji_id) ⇒ Object
20 21 22 |
# File 'lib/mattermost/endpoint/emoji.rb', line 20 def delete_custom_emoji(emoji_id) delete("/emoji/#{emoji_id}") end |
#get_custom_emoji(emoji_id) ⇒ Object
16 17 18 |
# File 'lib/mattermost/endpoint/emoji.rb', line 16 def get_custom_emoji(emoji_id) get("/emoji/#{emoji_id}") end |
#get_custom_emoji_image(emoji_id, file_name) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/mattermost/endpoint/emoji.rb', line 24 def get_custom_emoji_image(emoji_id, file_name) File.open(file_name, "w") do |file| file.binmode get(get_custom_emoji_image_url(emoji_id), stream_body: true) do |fragment| file.write(fragment) end end end |
#get_custom_emoji_image_url(emoji_id) ⇒ Object
33 34 35 |
# File 'lib/mattermost/endpoint/emoji.rb', line 33 def get_custom_emoji_image_url(emoji_id) "/emoji/#{emoji_id}/image" end |
#get_custom_emoji_list(max = 60) ⇒ Object
12 13 14 |
# File 'lib/mattermost/endpoint/emoji.rb', line 12 def get_custom_emoji_list(max = 60) get("/emoji?per_page=#{max}") end |