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
-
#creations_tracking ⇒ Object
Returns the value of attribute creations_tracking.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_queue ⇒ Object
Returns the value of attribute max_queue.
-
#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.
-
#requests_tracking ⇒ Object
Returns the value of attribute requests_tracking.
-
#ssl ⇒ Object
Returns the value of attribute ssl.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(api_key = '') ⇒ Config
constructor
A new instance of Config.
- #secret=(value) ⇒ Object
- #to_s ⇒ Object
- #update(options) ⇒ Object
Constructor Details
#initialize(api_key = '') ⇒ Config
Returns a new instance of Config.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/chillout/config.rb', line 30 def initialize(api_key = '') self.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 @strategy = :thread @max_queue = 5_000 @creations_tracking = true @requests_tracking = true @authentication_user = nil @authentication_password = nil 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
80 81 82 |
# File 'lib/chillout/config.rb', line 80 def authentication_password @authentication_password || api_key end |
#authentication_user ⇒ Object
76 77 78 |
# File 'lib/chillout/config.rb', line 76 def authentication_user @authentication_user || api_key end |
#creations_tracking ⇒ Object
Returns the value of attribute creations_tracking.
27 28 29 |
# File 'lib/chillout/config.rb', line 27 def creations_tracking @creations_tracking 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 |
#max_queue ⇒ Object
Returns the value of attribute max_queue.
26 27 28 |
# File 'lib/chillout/config.rb', line 26 def max_queue @max_queue 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 |
#requests_tracking ⇒ Object
Returns the value of attribute requests_tracking.
28 29 30 |
# File 'lib/chillout/config.rb', line 28 def requests_tracking @requests_tracking end |
#ssl ⇒ Object
Returns the value of attribute ssl.
24 25 26 |
# File 'lib/chillout/config.rb', line 24 def ssl @ssl end |
#strategy ⇒ Object
Returns the value of attribute strategy.
25 26 27 |
# File 'lib/chillout/config.rb', line 25 def strategy @strategy 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
#secret=(value) ⇒ Object
62 63 64 |
# File 'lib/chillout/config.rb', line 62 def secret=(value) self.api_key = value end |
#to_s ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/chillout/config.rb', line 84 def to_s <<-eos * hostname: #{hostname} * port: #{port} * ssl: #{ssl} eos end |
#update(options) ⇒ Object
48 49 50 51 52 |
# File 'lib/chillout/config.rb', line 48 def update() .each do |name, value| send("#{name}=", value) end end |