lib/app_monit/config.rb in app_monit-0.0.2 vs lib/app_monit/config.rb in app_monit-0.0.3
- old
+ new
@@ -1,9 +1,9 @@
module AppMonit
class Config
class << self
- attr_writer :api_key, :env, :end_point, :fail_silent
+ attr_writer :api_key, :env, :end_point, :fail_silent, :enabled
def api_key
@api_key || raise(ApiKeyNotSetError.new("Please set your API key"))
end
@@ -15,9 +15,13 @@
@end_point || "http://api.appmon.it"
end
def fail_silent
@fail_silent || false
+ end
+
+ def enabled?
+ @enabled.nil? ? env != "test" : @enabled
end
end
end
end