Sha256: 9d817954638975e5e1ca0d7a8c41871cb8ebf8836328a5c1c1c5007bf19185b5
Contents?: true
Size: 825 Bytes
Versions: 39
Compression:
Stored size: 825 Bytes
Contents
module DiscourseApi module API module Badges def badges response = get("/admin/badges.json") response.body end def user_badges(username) response = get("/users/#{username}/activity/badges.json") response.body['badges'] end def grant_user_badge(params={}) post("/user_badges", params) end def create_badge(params={}) args = API.params(params) .required(:name, :badge_type_id) .optional(:description, :allow_title, :multiple_grant, :icon, :listable, :target_posts, :query, :enabled, :auto_revoke, :badge_grouping_id, :trigger, :show_posts, :image, :long_description) post("/admin/badges.json", args) end end end end
Version data entries
39 entries across 39 versions & 1 rubygems