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

Class Method Details

.configObject



24
25
26
# File 'lib/toolhound-ruby/default.rb', line 24

def config
  @config ||= {}
end

.dataserverString

Default API endpoint from ENV or API_ENDPOINT

Returns:



30
31
32
# File 'lib/toolhound-ruby/default.rb', line 30

def dataserver
  ENV['TOOLHOUND_DATASERVER'] || config['dataserver']
end

.optionsHash

Configuration options

Returns:

  • (Hash)


18
19
20
# File 'lib/toolhound-ruby/default.rb', line 18

def options
  Hash[Toolhound::Configurable.keys.map{|key| [key, send(key)]}]
end

.passwordString

Default BIM360-Field password for Basic Auth from ENV

Returns:



50
51
52
# File 'lib/toolhound-ruby/default.rb', line 50

def password
  ENV['TOOLHOUND_PASSWORD'] || config['password']
end

.portObject



34
35
36
# File 'lib/toolhound-ruby/default.rb', line 34

def port
  ENV['TOOLHOUND_PORT'] || config['port'] || PORT
end

.timeoutObject



45
46
47
# File 'lib/toolhound-ruby/default.rb', line 45

def timeout
  config['timeout'] || 10
end

.usernameString

Default BIM360-Field username for Basic Auth from ENV

Returns:



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