Class: Buffer::Api::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/buffer/api/link.rb

Overview

Returns api instance to get information about links shared through Buffer.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Link

Returns a new instance of Link.



9
10
11
# File 'lib/buffer/api/link.rb', line 9

def initialize(client)
  @client = client
end

Instance Method Details

#shares(url, options = {}) ⇒ Object

Returns an object with a the numbers of shares a link has had using Buffer. ‘/link/shares’ GET

url - URL of the page for which the number of shares is requested.



17
18
19
20
21
22
23
24
# File 'lib/buffer/api/link.rb', line 17

def shares(url, options = {})
  body = options.has_key?(:query) ? options[:query] : {}
  body[:url] = url

  response = @client.get "/link/shares", body, options

  return response
end