Module: Toolhound::Default
- Defined in:
- lib/toolhound-ruby/default.rb
Overview
Default configuration options for Client
Constant Summary collapse
- PORT =
Default User Agent header string
1433.freeze
Class Method Summary collapse
- .config ⇒ Object
-
.dataserver ⇒ String
Default API endpoint from ENV or API_ENDPOINT.
-
.options ⇒ Hash
Configuration options.
-
.password ⇒ String
Default BIM360-Field password for Basic Auth from ENV.
- .port ⇒ Object
- .timeout ⇒ Object
-
.username ⇒ String
Default BIM360-Field username for Basic Auth from ENV.
Class Method Details
.config ⇒ Object
24 25 26 |
# File 'lib/toolhound-ruby/default.rb', line 24 def config @config ||= {} end |
.dataserver ⇒ String
Default API endpoint from ENV or API_ENDPOINT
30 31 32 |
# File 'lib/toolhound-ruby/default.rb', line 30 def dataserver ENV['TOOLHOUND_DATASERVER'] || config['dataserver'] end |
.options ⇒ Hash
Configuration options
18 19 20 |
# File 'lib/toolhound-ruby/default.rb', line 18 def Hash[Toolhound::Configurable.keys.map{|key| [key, send(key)]}] end |
.password ⇒ String
Default BIM360-Field password for Basic Auth from ENV
50 51 52 |
# File 'lib/toolhound-ruby/default.rb', line 50 def password ENV['TOOLHOUND_PASSWORD'] || config['password'] end |
.port ⇒ Object
34 35 36 |
# File 'lib/toolhound-ruby/default.rb', line 34 def port ENV['TOOLHOUND_PORT'] || config['port'] || PORT end |
.timeout ⇒ Object
45 46 47 |
# File 'lib/toolhound-ruby/default.rb', line 45 def timeout config['timeout'] || 10 end |
.username ⇒ String
Default BIM360-Field username for Basic Auth from ENV
40 41 42 43 |
# File 'lib/toolhound-ruby/default.rb', line 40 def username ENV['TOOLHOUND_USERNAME'] || config['username'] # ENV['NEARMISS_EMAIL'] || config['email'] end |