Class: SamsaraSDK::Config
- Inherits:
-
Object
- Object
- SamsaraSDK::Config
- Defined in:
- lib/samsara_sdk/config.rb
Overview
Samsara SDK default configuration and request constants.
Constant Summary collapse
- PUBLISHED_TIMESTAMP_HEADER =
Samsara specific HTTP Header
'X-Samsara-publishedTimestamp'.freeze
- API_PATH =
Samsara Ingestion API endpoint
'/v1/events'.freeze
Class Method Summary collapse
-
.get ⇒ Hash
Get configuration values.
-
.setup!(input_config) ⇒ Object
Set up configuration.
-
.timestamp ⇒ Integer
Generates current timestamp.
Class Method Details
.get ⇒ Hash
Get configuration values.
72 73 74 |
# File 'lib/samsara_sdk/config.rb', line 72 def get @values end |
.setup!(input_config) ⇒ Object
Set up configuration. Merges given config with defaults and validates the result.
64 65 66 67 |
# File 'lib/samsara_sdk/config.rb', line 64 def setup!(input_config) @values = @defaults.merge input_config validate @values end |
.timestamp ⇒ Integer
Generates current timestamp.
79 80 81 |
# File 'lib/samsara_sdk/config.rb', line 79 def (Time.now.to_f.round(3) * 1000).to_i end |