Class: Buffer::Api::Link
- Inherits:
-
Object
- Object
- Buffer::Api::Link
- Defined in:
- lib/buffer/api/link.rb
Overview
Returns api instance to get information about links shared through Buffer.
Instance Method Summary collapse
-
#initialize(client) ⇒ Link
constructor
A new instance of Link.
-
#shares(url, options = {}) ⇒ Object
Returns an object with a the numbers of shares a link has had using Buffer.
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, = {}) body = .has_key?(:query) ? [:query] : {} body[:url] = url response = @client.get "/link/shares", body, return response end |