-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
help.rb
64 lines (58 loc) · 2.47 KB
/
help.rb
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
57
58
59
60
61
62
63
64
require 'twitter/api/utils'
require 'twitter/configuration'
require 'twitter/language'
module Twitter
module API
module Help
include Twitter::API::Utils
# Returns the current configuration used by Twitter
#
# @see https://dev.twitter.com/docs/api/1.1/get/help/configuration
# @rate_limited Yes
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [Twitter::Configuration] Twitter's configuration.
# @example Return the current configuration used by Twitter
# Twitter.configuration
def configuration(options={})
object_from_response(Twitter::Configuration, :get, "/1.1/help/configuration.json", options)
end
# Returns the list of languages supported by Twitter
#
# @see https://dev.twitter.com/docs/api/1.1/get/help/languages
# @rate_limited Yes
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [Array<Twitter::Language>]
# @example Return the list of languages Twitter supports
# Twitter.languages
def languages(options={})
collection_from_response(Twitter::Language, :get, "/1.1/help/languages.json", options)
end
# Returns {https://twitter.com/privacy Twitter's Privacy Policy}
#
# @see https://dev.twitter.com/docs/api/1.1/get/help/privacy
# @rate_limited Yes
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [String]
# @example Return {https://twitter.com/privacy Twitter's Privacy Policy}
# Twitter.privacy
def privacy(options={})
get("/1.1/help/privacy.json", options)[:body][:privacy]
end
# Returns {https://twitter.com/tos Twitter's Terms of Service}
#
# @see https://dev.twitter.com/docs/api/1.1/get/help/tos
# @rate_limited Yes
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [String]
# @example Return {https://twitter.com/tos Twitter's Terms of Service}
# Twitter.tos
def tos(options={})
get("/1.1/help/tos.json", options)[:body][:tos]
end
end
end
end