Module: Particle::Default
- Defined in:
- lib/particle/default.rb
Overview
Default configuration options for Client
Constant Summary collapse
- API_ENDPOINT =
"https://api.particle.io".freeze
- USER_AGENT =
"particlerb Ruby gem #{Particle::VERSION}".freeze
Class Method Summary collapse
- .access_token ⇒ Object
- .api_endpoint ⇒ Object
-
.connection_options ⇒ Hash
Default options for Faraday::Connection.
-
.options ⇒ Hash
Configuration options.
-
.user_agent ⇒ String
Default User-Agent header string from USER_AGENT.
Class Method Details
.access_token ⇒ Object
23 24 25 |
# File 'lib/particle/default.rb', line 23 def access_token ENV['PARTICLE_ACCESS_TOKEN'] end |
.api_endpoint ⇒ Object
19 20 21 |
# File 'lib/particle/default.rb', line 19 def api_endpoint ENV['PARTICLE_API_ENDPOINT'] || API_ENDPOINT end |
.connection_options ⇒ Hash
Default options for Faraday::Connection
29 30 31 32 33 34 35 |
# File 'lib/particle/default.rb', line 29 def { :headers => { :user_agent => user_agent } } end |
.options ⇒ Hash
Configuration options
15 16 17 |
# File 'lib/particle/default.rb', line 15 def Hash[Particle::Configurable.keys.map { |key| [key, send(key)] }] end |
.user_agent ⇒ String
Default User-Agent header string from USER_AGENT
39 40 41 |
# File 'lib/particle/default.rb', line 39 def user_agent USER_AGENT end |