Class: Disqussion::Categories
- Defined in:
- lib/disqussion/client/categories.rb
Instance Method Summary collapse
-
#create(*args) ⇒ Hashie::Rash
Creates a new category.
-
#details(*args) ⇒ Hashie::Rash
Returns category details.
-
#list(*args) ⇒ Hashie::Rash
Returns a list of categories within a forum.
-
#listPosts(*args) ⇒ Hashie::Rash
Returns a list of posts within a category.
-
#listThreads(*args) ⇒ Hashie::Rash
Returns a list of threads within a category sorted by the date created.
Methods included from Request
Instance Method Details
#create(*args) ⇒ Hashie::Rash
Creates a new category. @accessibility: public key, secret key @methods: POST @format: json, jsonp @authenticated: false @limited: false @see: http://disqus.com/api/3.0/categories/create.json
17 18 19 20 21 22 23 24 25 |
# File 'lib/disqussion/client/categories.rb', line 17 def create(*args) = args.last.is_a?(Hash) ? args.pop : {} if args.size == 2 .merge!(:forum => args[0], :title => args[1]) response = post('categories/create', ) else puts "#{Kernel.caller.first}: categories.create expects 2 arguments: forum, title" end end |
#details(*args) ⇒ Hashie::Rash
Returns category details. @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: false @limited: false @see: http://disqus.com/api/3.0/categories/details.json
38 39 40 41 42 |
# File 'lib/disqussion/client/categories.rb', line 38 def details(*args) = args.last.is_a?(Hash) ? args.pop : {} [:category] = args.first response = get('categories/details', ) end |
#list(*args) ⇒ Hashie::Rash
Returns a list of categories within a forum. @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: false @limited: false @see: http://disqus.com/api/3.0/categories/list.json
60 61 62 63 |
# File 'lib/disqussion/client/categories.rb', line 60 def list(*args) = args.last.is_a?(Hash) ? args.pop : {} response = get('categories/list', ) end |
#listPosts(*args) ⇒ Hashie::Rash
Returns a list of posts within a category. @accessibility: public key, secret key @methods: GET @format: json, jsonp, rss @authenticated: false @limited: false @see: http://disqus.com/api/3.0/categories/listPosts.json
84 85 86 87 88 |
# File 'lib/disqussion/client/categories.rb', line 84 def listPosts(*args) = args.last.is_a?(Hash) ? args.pop : {} [:category] = args.first response = get('categories/listPosts', ) end |
#listThreads(*args) ⇒ Hashie::Rash
Returns a list of threads within a category sorted by the date created. @accessibility: public key, secret key @methods: GET @format: json, jsonp, rss @authenticated: false @limited: false @see: http://disqus.com/api/3.0/categories/listThreads.json
109 110 111 112 113 |
# File 'lib/disqussion/client/categories.rb', line 109 def listThreads(*args) = args.last.is_a?(Hash) ? args.pop : {} [:category] = args.first response = get('categories/listThreads', ) end |