Class: DoiConfig
- Inherits:
-
Object
- Object
- DoiConfig
- Defined in:
- app/models/doi_config.rb
Class Method Summary collapse
- .configure ⇒ Object
- .password ⇒ Object
- .shoulder ⇒ Object
- .url_for_creating_doi ⇒ Object
- .url_for_updating_doi ⇒ Object
- .username ⇒ Object
Class Method Details
.configure ⇒ Object
3 4 5 |
# File 'app/models/doi_config.rb', line 3 def self.configure @@config_info ||= YAML.load(File.open(File.join(Rails.root, "config/doi.yml"))) end |
.password ⇒ Object
11 12 13 |
# File 'app/models/doi_config.rb', line 11 def self.password configure[Rails.env]['password'] end |
.shoulder ⇒ Object
15 16 17 |
# File 'app/models/doi_config.rb', line 15 def self.shoulder configure[Rails.env]['shoulder'] end |
.url_for_creating_doi ⇒ Object
19 20 21 |
# File 'app/models/doi_config.rb', line 19 def self.url_for_creating_doi @@url_for_creating_doi ||= "#{configure[Rails.env]['url'].sub("://", "://#{username}:#{password}@")}shoulder/#{shoulder}" end |
.url_for_updating_doi ⇒ Object
23 24 25 |
# File 'app/models/doi_config.rb', line 23 def self.url_for_updating_doi @@url_for_updating_doi ||= "#{configure[Rails.env]['url'].sub("://", "://#{username}:#{password}@")}id/" end |
.username ⇒ Object
7 8 9 |
# File 'app/models/doi_config.rb', line 7 def self.username configure[Rails.env]['username'] end |