Sha256: 460790d9a8035773fb6e0d49e85433e68945b24038597b26dd049d37f7bd9f9e

Contents?: true

Size: 1.33 KB

Versions: 7

Compression:

Stored size: 1.33 KB

Contents

module Assistly
  class Client
    # Defines methods related to users
    module User
      # Returns extended information of a given user
      #
      # @overload user(user, options={})
      #   @param user [Integer] An Assitely user ID
      #   @option options [Boolean, String, Integer] :include_entities Include {http://dev.twitter.com/pages/tweet_entities Tweet Entities} when set to true, 't' or 1.
      #   @return [Hashie::Mash] The requested user.
      #   @example Return extended information for 12345
      #     Assistly.user(12345)
      # @format :json, :xml
      # @authenticated true
      # @see http://dev.assistly.com/docs/api/users/show
      def user(id,*args)
        options = args.last.is_a?(Hash) ? args.pop : {}
        response = get("users/#{id}",options)
        response.user
      end

      # Returns extended information for up to 100 users
      #
      # @format :json, :xml
      # @authenticated true
      # @rate_limited true
      # @return [Array] The requested users.
      # @see http://dev.assistly.com/docs/api/users
      # @example Return extended information account users
      #   Assistly.users
      def users(*args)
        options = args.last.is_a?(Hash) ? args.pop : {}
        response = get('users', options)
        response['results'].collect{|result| result.user}
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
assistly-0.2.0 lib/assistly/client/user.rb
assistly-0.1.5 lib/assistly/client/user.rb
assistly-0.1.4 lib/assistly/client/user.rb
assistly-0.1.3 lib/assistly/client/user.rb
assistly-0.1.2 lib/assistly/client/user.rb
assistly-0.1.1 lib/assistly/client/user.rb
assistly-0.1 lib/assistly/client/user.rb