Class: Happi::Configuration
- Inherits:
-
Object
- Object
- Happi::Configuration
- Defined in:
- lib/happi/configuration.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#oauth_token ⇒ Object
Returns the value of attribute oauth_token.
-
#port ⇒ Object
Returns the value of attribute port.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#use_json ⇒ Object
Returns the value of attribute use_json.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(options = {}) ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 19 |
# File 'lib/happi/configuration.rb', line 15 def initialize( = {}) self.class.defaults.merge().each do |key, value| send("#{key}=", value) end end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
13 14 15 |
# File 'lib/happi/configuration.rb', line 13 def host @host end |
#log_level ⇒ Object
Returns the value of attribute log_level.
13 14 15 |
# File 'lib/happi/configuration.rb', line 13 def log_level @log_level end |
#oauth_token ⇒ Object
Returns the value of attribute oauth_token.
13 14 15 |
# File 'lib/happi/configuration.rb', line 13 def oauth_token @oauth_token end |
#port ⇒ Object
Returns the value of attribute port.
13 14 15 |
# File 'lib/happi/configuration.rb', line 13 def port @port end |
#timeout ⇒ Object
Returns the value of attribute timeout.
13 14 15 |
# File 'lib/happi/configuration.rb', line 13 def timeout @timeout end |
#use_json ⇒ Object
Returns the value of attribute use_json.
13 14 15 |
# File 'lib/happi/configuration.rb', line 13 def use_json @use_json end |
#version ⇒ Object
Returns the value of attribute version.
13 14 15 |
# File 'lib/happi/configuration.rb', line 13 def version @version end |
Class Method Details
.defaults ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/happi/configuration.rb', line 2 def self.defaults { host: 'http://localhost:8080', port: 443, timeout: 60, version: 'v1', use_json: false, log_level: :info } end |