Class: Chillout::Config
- Inherits:
-
Object
- Object
- Chillout::Config
- Defined in:
- lib/chillout/config.rb
Constant Summary collapse
- DEFAULT_HOSTNAME =
"api.chillout.io"
- DEFAULT_PORT =
443
- DEFAULT_NOTIFIER_NAME =
"Chillout"
- DEFAULT_NOTIFIER_URL =
"http://github.com/chilloutio/chillout"
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
- #authentication_password ⇒ Object
- #authentication_user ⇒ Object
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#notifier_name ⇒ Object
Returns the value of attribute notifier_name.
-
#notifier_url ⇒ Object
Returns the value of attribute notifier_url.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#port ⇒ Object
Returns the value of attribute port.
-
#ssl ⇒ Object
Returns the value of attribute ssl.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(api_key = nil) ⇒ Config
constructor
A new instance of Config.
- #to_s ⇒ Object
- #update(options) ⇒ Object
Constructor Details
#initialize(api_key = nil) ⇒ Config
Returns a new instance of Config.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/chillout/config.rb', line 26 def initialize(api_key = nil) @api_key = api_key @hostname = DEFAULT_HOSTNAME @port = DEFAULT_PORT @notifier_name = DEFAULT_NOTIFIER_NAME @notifier_url = DEFAULT_NOTIFIER_URL @version = VERSION @logger = Logger.new(STDOUT) @ssl = true end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
20 21 22 |
# File 'lib/chillout/config.rb', line 20 def api_key @api_key end |
#authentication_password ⇒ Object
47 48 49 |
# File 'lib/chillout/config.rb', line 47 def authentication_password @authentication_password || api_key end |
#authentication_user ⇒ Object
43 44 45 |
# File 'lib/chillout/config.rb', line 43 def authentication_user @authentication_user || api_key end |
#environment ⇒ Object
Returns the value of attribute environment.
13 14 15 |
# File 'lib/chillout/config.rb', line 13 def environment @environment end |
#hostname ⇒ Object
Returns the value of attribute hostname.
18 19 20 |
# File 'lib/chillout/config.rb', line 18 def hostname @hostname end |
#logger ⇒ Object
Returns the value of attribute logger.
23 24 25 |
# File 'lib/chillout/config.rb', line 23 def logger @logger end |
#notifier_name ⇒ Object
Returns the value of attribute notifier_name.
14 15 16 |
# File 'lib/chillout/config.rb', line 14 def notifier_name @notifier_name end |
#notifier_url ⇒ Object
Returns the value of attribute notifier_url.
15 16 17 |
# File 'lib/chillout/config.rb', line 15 def notifier_url @notifier_url end |
#platform ⇒ Object
Returns the value of attribute platform.
17 18 19 |
# File 'lib/chillout/config.rb', line 17 def platform @platform end |
#port ⇒ Object
Returns the value of attribute port.
19 20 21 |
# File 'lib/chillout/config.rb', line 19 def port @port end |
#ssl ⇒ Object
Returns the value of attribute ssl.
24 25 26 |
# File 'lib/chillout/config.rb', line 24 def ssl @ssl end |
#version ⇒ Object
Returns the value of attribute version.
16 17 18 |
# File 'lib/chillout/config.rb', line 16 def version @version end |
Instance Method Details
#to_s ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/chillout/config.rb', line 51 def to_s <<-eos * hostname: #{hostname} * port: #{port} * ssl: #{ssl} eos end |
#update(options) ⇒ Object
37 38 39 40 41 |
# File 'lib/chillout/config.rb', line 37 def update() .each do |name, value| send("#{name}=", value) end end |