Sha256: f31f909c4f1265d4ab3d55da0f3ae2e621a2a33330dd1393e980e0c07c90b86d

Contents?: true

Size: 1.52 KB

Versions: 21

Compression:

Stored size: 1.52 KB

Contents

module Bearcat
  class Client < Footrest::Client
    module Users

      def list_users(account, params={})
        get("/api/v1/accounts/#{account.to_s}/users", params)
      end

      def user_avatars(user, params={})
        get("/api/v1/users/#{user.to_s}/avatars", params)
      end

      def add_user(account, params={})
        post("/api/v1/accounts/#{account.to_s}/users", params)
      end

      def user_profile(user)
        get("/api/v1/users/#{user.to_s}/profile")
      end

      # scope: food
      # params: {ns: 'com.account-domain.canvas-app'}
      # returns all custom user food scope data. If no scope returns all custom user data
      def load_custom_data(user, params, scope = '')
        get("/api/v1/users/#{user}/custom_data/#{scope}", params)
      end

      # scope: food
      # params: {ns: 'com.account-domain.canvas-app',
      #          data: {'favorite' => 'steak', 'least favorite' => 'water mellon'}}
      # stores custom data in the food scope
      def store_custom_data(user, params, scope = '')
        put("/api/v1/users/#{user}/custom_data/#{scope}", params)
      end

      # scope: food
      # params: {ns: 'com.account-domain.canvas-app'}
      # deletes all custom user data for the food scope. If no scope deletes all custom user data
      def delete_custom_data(user, params, scope = '')
        delete("/api/v1/users/#{user}/custom_data/#{scope}", params)
      end

      def page_views(user, params = {})
        get("/api/v1/users/#{user}/page_views", params)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
bearcat-0.9.12 lib/bearcat/client/users.rb