Sha256: d4a16dcd9fc92ddd5cb9bc61bfbbe09ddcd384dddfe2bc23a281f9bda85d1d6b

Contents?: true

Size: 627 Bytes

Versions: 2

Compression:

Stored size: 627 Bytes

Contents

module Coop
  class User < APIObject
    # Public: List of a group's users with all info
    #
    # Examples
    #
    #   User.new({ group_id: 12345 }).all
    #   # => [#<Coop::APIObject>, #<Coop::APIObject>, ...]
    #
    # Returns Array of APIObjects with user data
    def all
      Coop.get_parsed("/group/#{self.group_id}/users")
    end
    
    # Public: User data for one user
    #
    # id - The user's id
    #
    # Examples
    #
    #   User.find(12345)
    #   # => #<Coop::APIObject>
    #
    # Returns  APIObject with user data
    def self.find(id)
      Coop.get_parsed("/users/#{id}")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coop-1.0.1 lib/coop/api_object/user.rb
coop-1.0.0 lib/coop/api_object/user.rb