Module: Datarank::Client::Comments

Included in:
Datarank::Client
Defined in:
lib/datarank/comments.rb

Overview

Module containing methods for interacting with comments

Instance Method Summary collapse

Instance Method Details

#comments_search(slug, options = {}) ⇒ Object

Query interface for comments correlated to a topic

Parameters:

  • slug (String)

    A topic’s unique identifier slug

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :limit (1..1000)

    The number of items to return.

  • - (Object)

    all query options available in API docs



12
13
14
# File 'lib/datarank/comments.rb', line 12

def comments_search(slug, options={})
  get "/topics/#{slug}/comments", options
end

#comments_top(slug, options = {}) ⇒ Object

Query interface for top 20 comments correlated to a topic by datarank score

Parameters:

  • slug (String)

    A topic’s unique identifier slug



19
20
21
# File 'lib/datarank/comments.rb', line 19

def comments_top(slug, options={})
  get "/topics/#{slug}/comments/top", options
end