Class: AppMonit::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/app_monit/config.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject



6
7
8
# File 'lib/app_monit/config.rb', line 6

def api_key
  @api_key || raise(ApiKeyNotSetError.new("Please set your API key"))
end

.enabled=(value) ⇒ Object (writeonly)

Sets the attribute enabled

Parameters:

  • value

    the value to set the attribute enabled to.



4
5
6
# File 'lib/app_monit/config.rb', line 4

def enabled=(value)
  @enabled = value
end

.end_pointObject



14
15
16
# File 'lib/app_monit/config.rb', line 14

def end_point
  @end_point || "https://api.appmon.it"
end

.envObject



10
11
12
# File 'lib/app_monit/config.rb', line 10

def env
  @env || "development"
end

.fail_silentObject



22
23
24
# File 'lib/app_monit/config.rb', line 22

def fail_silent
  @fail_silent || false
end

.timeoutObject



30
31
32
# File 'lib/app_monit/config.rb', line 30

def timeout
  @timeout || 1
end

.versionObject



18
19
20
# File 'lib/app_monit/config.rb', line 18

def version
  @version || "v1"
end

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/app_monit/config.rb', line 26

def enabled?
  @enabled.nil? ? env != "test" : @enabled
end