Class: PostyClient::Settings
- Inherits:
-
Object
- Object
- PostyClient::Settings
- Defined in:
- lib/posty_client/settings.rb
Class Method Summary collapse
- .access_token ⇒ Object
- .api_url ⇒ Object
- .api_version ⇒ Object
- .current_server ⇒ Object
- .current_server=(server) ⇒ Object
- .current_settings ⇒ Object
- .servers ⇒ Object
Class Method Details
.access_token ⇒ Object
29 30 31 |
# File 'lib/posty_client/settings.rb', line 29 def self.access_token current_settings['access_token'] end |
.api_url ⇒ Object
33 34 35 |
# File 'lib/posty_client/settings.rb', line 33 def self.api_url current_settings['api_url'] end |
.api_version ⇒ Object
37 38 39 |
# File 'lib/posty_client/settings.rb', line 37 def self.api_version current_settings['api_version'] end |
.current_server ⇒ Object
13 14 15 |
# File 'lib/posty_client/settings.rb', line 13 def self.current_server Thread.current["attr_#{name}_current_server"] end |
.current_server=(server) ⇒ Object
17 18 19 |
# File 'lib/posty_client/settings.rb', line 17 def self.current_server=(server) Thread.current["attr_#{name}_current_server"] = server end |
.current_settings ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/posty_client/settings.rb', line 21 def self.current_settings if current_server.present? settings[PostyClient.env]['servers'][current_server] else settings[PostyClient.env] end end |
.servers ⇒ Object
9 10 11 |
# File 'lib/posty_client/settings.rb', line 9 def self.servers settings[PostyClient.env]['servers'].keys end |