Module: HighwindsAPI
- Defined in:
- lib/highwinds-api.rb,
lib/highwinds-api/content.rb
Defined Under Namespace
Classes: Content
Constant Summary collapse
- ONE_HOUR_IN_SECONDS =
3600
Class Method Summary collapse
-
.clear_token ⇒ Object
should be used only in testing scenarios.
- .credentials ⇒ Object
- .get_token ⇒ Object
- .set_credentials(username, password) ⇒ Object
Class Method Details
.clear_token ⇒ Object
should be used only in testing scenarios
27 28 29 30 |
# File 'lib/highwinds-api.rb', line 27 def self.clear_token @token = nil @token_time = nil end |
.credentials ⇒ Object
6 7 8 9 10 11 |
# File 'lib/highwinds-api.rb', line 6 def self.credentials { username: @username, password: @password } end |
.get_token ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/highwinds-api.rb', line 18 def self.get_token unless (@token_time and Time.now - @token_time < ONE_HOUR_IN_SECONDS) @token = Content::get_token @token_time = Time.now end @token end |
.set_credentials(username, password) ⇒ Object
13 14 15 16 |
# File 'lib/highwinds-api.rb', line 13 def self.set_credentials(username, password) @username = username @password = password end |