Class: Figshare::Base
- Inherits:
-
Object
- Object
- Figshare::Base
- Defined in:
- lib/base.rb
Overview
Supporting web calls to the API
Direct Known Subclasses
Authors, Institutions, Other, PrivateArticles, PrivateCollections, PrivateProjects, PublicArticles, PublicCollections, PublicProjects
Instance Attribute Summary collapse
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#article_index_file ⇒ Object
Returns the value of attribute article_index_file.
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#base_dir ⇒ Object
Returns the value of attribute base_dir.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#institute_id ⇒ Object
Returns the value of attribute institute_id.
Instance Method Summary collapse
-
#initialize(figshare_user:, conf_dir:) ⇒ Base
constructor
Init reads the Json configuration files, setting @course_codes_to_faculty and @academic_department_code_to_faculty Opens a connection to the LDAP server, setting @ldap for other methods to use.
Constructor Details
#initialize(figshare_user:, conf_dir:) ⇒ Base
Init reads the Json configuration files, setting @course_codes_to_faculty and @academic_department_code_to_faculty Opens a connection to the LDAP server, setting @ldap for other methods to use.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/base.rb', line 21 def initialize(figshare_user:, conf_dir:) figshare_token = load_json_file("#{conf_dir}/figshare_keys.json") @auth_token = figshare_token[figshare_user] figshare_site_params = load_json_file("#{conf_dir}/figshare_site_params.json") @hostname = figshare_site_params['host'] @api_url = figshare_site_params['api_url'] @institute_id = figshare_site_params['institute_id'] end |
Instance Attribute Details
#api_url ⇒ Object
Returns the value of attribute api_url.
13 14 15 |
# File 'lib/base.rb', line 13 def api_url @api_url end |
#article_index_file ⇒ Object
Returns the value of attribute article_index_file.
11 12 13 |
# File 'lib/base.rb', line 11 def article_index_file @article_index_file end |
#auth_token ⇒ Object
Returns the value of attribute auth_token.
9 10 11 |
# File 'lib/base.rb', line 9 def auth_token @auth_token end |
#base_dir ⇒ Object
Returns the value of attribute base_dir.
10 11 12 |
# File 'lib/base.rb', line 10 def base_dir @base_dir end |
#hostname ⇒ Object
Returns the value of attribute hostname.
12 13 14 |
# File 'lib/base.rb', line 12 def hostname @hostname end |
#institute_id ⇒ Object
Returns the value of attribute institute_id.
14 15 16 |
# File 'lib/base.rb', line 14 def institute_id @institute_id end |