File: help.rb

package info (click to toggle)
ruby-twitter 7.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,840 kB
  • sloc: ruby: 10,919; makefile: 6
file content (56 lines) | stat: -rw-r--r-- 2,138 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'twitter/configuration'
require 'twitter/language'
require 'twitter/rest/request'
require 'twitter/rest/utils'

module Twitter
  module REST
    module Help
      include Twitter::REST::Utils

      # Returns the current configuration used by Twitter
      #
      # @see https://dev.twitter.com/rest/reference/get/help/configuration
      # @rate_limited Yes
      # @authentication Requires user context
      # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
      # @return [Twitter::Configuration] Twitter's configuration.
      def configuration(options = {})
        perform_get_with_object('/1.1/help/configuration.json', options, Twitter::Configuration)
      end

      # Returns the list of languages supported by Twitter
      #
      # @see https://dev.twitter.com/rest/reference/get/help/languages
      # @rate_limited Yes
      # @authentication Requires user context
      # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
      # @return [Array<Twitter::Language>]
      def languages(options = {})
        perform_get_with_objects('/1.1/help/languages.json', options, Twitter::Language)
      end

      # Returns {https://twitter.com/privacy Twitter's Privacy Policy}
      #
      # @see https://dev.twitter.com/rest/reference/get/help/privacy
      # @rate_limited Yes
      # @authentication Requires user context
      # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
      # @return [String]
      def privacy(options = {})
        perform_get('/1.1/help/privacy.json', options)[:privacy]
      end

      # Returns {https://twitter.com/tos Twitter's Terms of Service}
      #
      # @see https://dev.twitter.com/rest/reference/get/help/tos
      # @rate_limited Yes
      # @authentication Requires user context
      # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
      # @return [String]
      def tos(options = {})
        perform_get('/1.1/help/tos.json', options)[:tos]
      end
    end
  end
end