class EmojiDiffer::SlackApi

Constants

API_ENDPOINT

Public Instance Methods

emoji() click to toggle source
# File lib/emoji_differ/slack_api.rb, line 24
def emoji
  EmojiDiffer::List.from_json(raw_response.body)
end
raw_response() click to toggle source
# File lib/emoji_differ/slack_api.rb, line 8
def raw_response
  @raw_response ||= Net::HTTP.get_response(uri).tap do |handle|
    if !handle.is_a?(Net::HTTPSuccess)
      raise "Slack API is out of business today, #{handle.inspect}"
    end
  end
end
uri() click to toggle source
# File lib/emoji_differ/slack_api.rb, line 16
def uri
  URI(API_ENDPOINT).tap do |uri|
    uri.query = URI.encode_www_form({
      token: token,
    })
  end
end