Class: Happi::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/happi/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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(options = {})
  self.class.defaults.merge(options).each do |key, value|
    send("#{key}=", value)
  end
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



13
14
15
# File 'lib/happi/configuration.rb', line 13

def host
  @host
end

#log_levelObject

Returns the value of attribute log_level.



13
14
15
# File 'lib/happi/configuration.rb', line 13

def log_level
  @log_level
end

#oauth_tokenObject

Returns the value of attribute oauth_token.



13
14
15
# File 'lib/happi/configuration.rb', line 13

def oauth_token
  @oauth_token
end

#portObject

Returns the value of attribute port.



13
14
15
# File 'lib/happi/configuration.rb', line 13

def port
  @port
end

#timeoutObject

Returns the value of attribute timeout.



13
14
15
# File 'lib/happi/configuration.rb', line 13

def timeout
  @timeout
end

#use_jsonObject

Returns the value of attribute use_json.



13
14
15
# File 'lib/happi/configuration.rb', line 13

def use_json
  @use_json
end

#versionObject

Returns the value of attribute version.



13
14
15
# File 'lib/happi/configuration.rb', line 13

def version
  @version
end

Class Method Details

.defaultsObject



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