Class: Figshare::Authors
Overview
Figshare Author APIs
Instance Attribute Summary
Attributes inherited from Base
#api_url, #article_index_file, #auth_token, #base_dir, #hostname, #institute_id
Instance Method Summary collapse
-
#detail(author_id:) {|Hash| ... } ⇒ Object
Get an authors details.
-
#search(search_for:, institute: false, group_id: nil, orcid: nil, is_active: true, is_public: true, order: 'published_date', order_direction: 'desc', page: nil, page_size: nil, offset: nil, limit: nil) {|Hash| ... } ⇒ Object
Search authors.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Figshare::Base
Instance Method Details
#detail(author_id:) {|Hash| ... } ⇒ Object
Get an authors details
52 53 54 |
# File 'lib/authors.rb', line 52 def detail(author_id:, &block) get(api_query: "account/authors/#{}", &block) end |
#search(search_for:, institute: false, group_id: nil, orcid: nil, is_active: true, is_public: true, order: 'published_date', order_direction: 'desc', page: nil, page_size: nil, offset: nil, limit: nil) {|Hash| ... } ⇒ Object
Search authors
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/authors.rb', line 19 def search( search_for:, institute: false, group_id: nil, orcid: nil, is_active: true, is_public: true, order: 'published_date', order_direction: 'desc', page: nil, page_size: nil, offset: nil, limit: nil, &block ) args = { 'search_for' => search_for } args['institution'] = @institute_id.to_i if institute args['group_id'] = group_id unless group_id.nil? args['is_active'] = is_active unless is_active.nil? args['is_public'] = is_public unless is_public.nil? args['orcid'] = orcid unless orcid.nil? args['order'] = order unless order.nil? args['order_direction'] = order_direction unless order_direction.nil? args['page'] = page unless page.nil? args['page_size'] = page_size unless page_size.nil? args['offset'] = offset unless offset.nil? args['limit'] = limit unless limit.nil? post_paginate(api_query: 'account/authors/search', args: args, &block) end |