Class: Rack::Reqorder::Configuration
- Inherits:
-
Object
- Object
- Rack::Reqorder::Configuration
- Defined in:
- lib/rack/reqorder.rb
Instance Attribute Summary collapse
-
#auth_email ⇒ Object
Returns the value of attribute auth_email.
-
#auth_password ⇒ Object
Returns the value of attribute auth_password.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#exception_monitoring ⇒ Object
Returns the value of attribute exception_monitoring.
-
#metrics_monitoring ⇒ Object
Returns the value of attribute metrics_monitoring.
-
#mongoid_yml ⇒ Object
Returns the value of attribute mongoid_yml.
-
#no_auth ⇒ Object
Returns the value of attribute no_auth.
-
#request_monitoring ⇒ Object
Returns the value of attribute request_monitoring.
Instance Method Summary collapse
- #app_environment ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
67 68 69 70 71 72 73 74 |
# File 'lib/rack/reqorder.rb', line 67 def initialize self.auth_email = '[email protected]' if auth_email.blank? self.auth_password = 'password' if auth_password.blank? self.no_auth = false if self.no_auth.blank? self.metrics_monitoring = true if self.metrics_monitoring.blank? self.exception_monitoring = true if self.exception_monitoring.blank? self.request_monitoring = true if self.request_monitoring.blank? end |
Instance Attribute Details
#auth_email ⇒ Object
Returns the value of attribute auth_email.
45 46 47 |
# File 'lib/rack/reqorder.rb', line 45 def auth_email @auth_email end |
#auth_password ⇒ Object
Returns the value of attribute auth_password.
45 46 47 |
# File 'lib/rack/reqorder.rb', line 45 def auth_password @auth_password end |
#environment ⇒ Object
Returns the value of attribute environment.
45 46 47 |
# File 'lib/rack/reqorder.rb', line 45 def environment @environment end |
#exception_monitoring ⇒ Object
Returns the value of attribute exception_monitoring.
45 46 47 |
# File 'lib/rack/reqorder.rb', line 45 def exception_monitoring @exception_monitoring end |
#metrics_monitoring ⇒ Object
Returns the value of attribute metrics_monitoring.
45 46 47 |
# File 'lib/rack/reqorder.rb', line 45 def metrics_monitoring @metrics_monitoring end |
#mongoid_yml ⇒ Object
Returns the value of attribute mongoid_yml.
45 46 47 |
# File 'lib/rack/reqorder.rb', line 45 def mongoid_yml @mongoid_yml end |
#no_auth ⇒ Object
Returns the value of attribute no_auth.
45 46 47 |
# File 'lib/rack/reqorder.rb', line 45 def no_auth @no_auth end |
#request_monitoring ⇒ Object
Returns the value of attribute request_monitoring.
45 46 47 |
# File 'lib/rack/reqorder.rb', line 45 def request_monitoring @request_monitoring end |
Instance Method Details
#app_environment ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/rack/reqorder.rb', line 59 def app_environment if Module.const_defined?(:Rails) return Rails.env else return ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development' end end |
#validate! ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/rack/reqorder.rb', line 48 def validate! if mongoid_yml.blank? raise 'You need to setup mongoid.yml before using this gem' end if environment.blank? self.environment = app_environment end end |