Module: Nearmiss::Client::Bookmarks

Defined in:
lib/toolhound-ruby/client/bookmarks.rb

Overview

Methods for the Bookmarks API

Instance Method Summary collapse

Instance Method Details

#bookmark(bookmark, options = {}) ⇒ Sawyer::Resource

Get a single bookmark

Parameters:

  • bookmark (String)

    ID of bookmark to fetch

Returns:

  • (Sawyer::Resource)

    Bookmark information



21
22
23
# File 'lib/toolhound-ruby/client/bookmarks.rb', line 21

def bookmark(bookmark, options={})
  get "bookmarks/#{bookmark}", options
end

#bookmarks(options = {}) ⇒ Array<Sawyer::Resource> Also known as: list_bookmarks

List bookmarks

Returns:

  • (Array<Sawyer::Resource>)

    List of bookmarks



11
12
13
# File 'lib/toolhound-ruby/client/bookmarks.rb', line 11

def bookmarks(options = {})
  paginate "bookmarks", options
end

#delete_bookmark(bookmark_id, options = {}) ⇒ Boolean

Delete a bookmark

Examples:

@client.delete_bookmark('208sdaz3')

Parameters:

  • bookmark_id (String)

    Id of the bookmark.

Returns:

  • (Boolean)

    True if bookmark deleted, false otherwise.



32
33
34
35
# File 'lib/toolhound-ruby/client/bookmarks.rb', line 32

def delete_bookmark(bookmark_id, options={})
  boolean_from_response(:delete, "bookmarks/#{bookmark_id}", options)

end