Sha256: 1afd940fc6aac30a5c4ea737a95ef99bb0c860d4a3107d32e9082a5d9278b8c5

Contents?: true

Size: 755 Bytes

Versions: 10

Compression:

Stored size: 755 Bytes

Contents

require 'json'

module Mattermost
	module Endpoint
		module Emoji

			def create_custom_emoji(image_file, emoji)
				#post("/emoji", emoji.to_json)
				raise NotImplementedError
			end

			def get_custom_emoji_list(max = 60)
				get("/emoji?per_page=#{max}")
			end

			def get_custom_emoji(emoji_id)
				get("/emoji/#{emoji_id}")
			end

			def delete_custom_emoji(emoji_id)
				delete("/emoji/#{emoji_id}")
			end

			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

			def get_custom_emoji_image_url(emoji_id)
				"/emoji/#{emoji_id}/image"
			end
		end
	end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mattermost-api4-ruby-0.0.10 lib/mattermost/endpoint/emoji.rb
mattermost-api4-ruby-0.0.9 lib/mattermost/endpoint/emoji.rb
mattermost-api4-ruby-0.0.8 lib/mattermost/endpoint/emoji.rb
mattermost-api4-ruby-0.0.7 lib/mattermost/endpoint/emoji.rb
mattermost-api4-ruby-0.0.6 lib/mattermost/endpoint/emoji.rb
mattermost-api4-ruby-0.0.5 lib/mattermost/endpoint/emoji.rb
mattermost-api4-ruby-0.0.4 lib/mattermost/endpoint/emoji.rb
mattermost-api4-ruby-0.0.3 lib/mattermost/endpoint/emoji.rb
mattermost-api4-ruby-0.0.2 lib/mattermost/endpoint/emoji.rb
mattermost-api4-ruby-0.0.1 lib/mattermost/endpoint/emoji.rb