Sha256: 2ddcf9647f109a1bfc4a6dca7f2799c8b36a0e19900b56b2aaca7a29b7d34e9b

Contents?: true

Size: 629 Bytes

Versions: 2

Compression:

Stored size: 629 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 an 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.1.1 lib/coop/api_object/user.rb
coop-1.1.0 lib/coop/api_object/user.rb