Module: BWAPI::Client::Author

Included in:
BWAPI::Client
Defined in:
lib/bwapi/client/author.rb

Overview

Author module for author endpoints

Instance Method Summary collapse

Instance Method Details

#author_interests(opts = {}) ⇒ Hash

Gets all author interests

Parameters:

  • (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • page (Integer)

    Page of results to retrieve

  • pageSize (Integer)

    Results per page of results

Returns:

  • All author interests



21
22
23
# File 'lib/bwapi/client/author.rb', line 21

def author_interests(opts = {})
  get 'authors/interests', opts
end

#author_professions(opts = {}) ⇒ Hash

Gets all author professions

Parameters:

  • (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • page (Integer)

    Page of results to retrieve

  • pageSize (Integer)

    Results per page of results

Returns:

  • All author professions



11
12
13
# File 'lib/bwapi/client/author.rb', line 11

def author_professions(opts = {})
  get 'authors/professions', opts
end

#get_author(name, opts = {}) ⇒ Hash

Get an Author with its associated accounts using an account name/domain tuple

Parameters:

  • Account username

  • (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • domain (String)

    Account domain

Returns:

  • Author



31
32
33
# File 'lib/bwapi/client/author.rb', line 31

def get_author(name, opts = {})
  get "authors/#{name}", opts
end

#update_author(name, opts = {}) ⇒ Hash

Update an Author using an account name/domain tuple

Parameters:

  • Account username

  • (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • accountType (String)

    Account type of Author Patch

  • addInterests (Array)

    Interests to add of Author Patch

  • addProfessions (Array)

    Professions to add of Author Patch

  • domain (String)

    Domain of Author Patch

  • gender (String)

    Gender of Author Patch

  • projectId (Integer)

    Project ID of Author Patch

  • queryId (Integer)

    Query ID of Author Patch

  • removeInterests (Array)

    Interests to remove of Author Patch

  • removeProfessions (Array)

    Professions to remove of Author Patch

  • resourceId (Integer)

    Resource ID of Author Patch

  • username (String)

    Username of Author to be patched

Returns:

  • Updated author



51
52
53
# File 'lib/bwapi/client/author.rb', line 51

def update_author(name, opts = {})
  patch "authors/#{name}", opts
end