Class: RailsMaint::Configuration
- Inherits:
-
Object
- Object
- RailsMaint::Configuration
- Defined in:
- lib/rails_maint/configuration.rb
Constant Summary collapse
- ALLOWED_LOCALE_PATTERN =
/\A[a-z]{2}(-[A-Z]{2})?\z/
Instance Attribute Summary collapse
-
#bypass_paths ⇒ Object
Returns the value of attribute bypass_paths.
-
#config_file_path ⇒ Object
Returns the value of attribute config_file_path.
-
#custom_page_path ⇒ Object
Returns the value of attribute custom_page_path.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#maintenance_file_path ⇒ Object
Returns the value of attribute maintenance_file_path.
-
#maintenance_paths ⇒ Object
Returns the value of attribute maintenance_paths.
-
#retry_after ⇒ Object
Returns the value of attribute retry_after.
-
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
-
#white_listed_ips ⇒ Object
Returns the value of attribute white_listed_ips.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rails_maint/configuration.rb', line 13 def initialize @locale = 'en' @white_listed_ips = [] @maintenance_file_path = 'tmp/maintenance_mode.txt' @custom_page_path = nil @config_file_path = 'config/rails_maint.yml' @retry_after = 3600 @bypass_paths = [] @maintenance_paths = [] @webhook_url = nil end |
Instance Attribute Details
#bypass_paths ⇒ Object
Returns the value of attribute bypass_paths.
9 10 11 |
# File 'lib/rails_maint/configuration.rb', line 9 def bypass_paths @bypass_paths end |
#config_file_path ⇒ Object
Returns the value of attribute config_file_path.
9 10 11 |
# File 'lib/rails_maint/configuration.rb', line 9 def config_file_path @config_file_path end |
#custom_page_path ⇒ Object
Returns the value of attribute custom_page_path.
9 10 11 |
# File 'lib/rails_maint/configuration.rb', line 9 def custom_page_path @custom_page_path end |
#locale ⇒ Object
Returns the value of attribute locale.
9 10 11 |
# File 'lib/rails_maint/configuration.rb', line 9 def locale @locale end |
#maintenance_file_path ⇒ Object
Returns the value of attribute maintenance_file_path.
9 10 11 |
# File 'lib/rails_maint/configuration.rb', line 9 def maintenance_file_path @maintenance_file_path end |
#maintenance_paths ⇒ Object
Returns the value of attribute maintenance_paths.
9 10 11 |
# File 'lib/rails_maint/configuration.rb', line 9 def maintenance_paths @maintenance_paths end |
#retry_after ⇒ Object
Returns the value of attribute retry_after.
9 10 11 |
# File 'lib/rails_maint/configuration.rb', line 9 def retry_after @retry_after end |
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
9 10 11 |
# File 'lib/rails_maint/configuration.rb', line 9 def webhook_url @webhook_url end |
#white_listed_ips ⇒ Object
Returns the value of attribute white_listed_ips.
9 10 11 |
# File 'lib/rails_maint/configuration.rb', line 9 def white_listed_ips @white_listed_ips end |
Instance Method Details
#validate! ⇒ Object
25 26 27 28 29 |
# File 'lib/rails_maint/configuration.rb', line 25 def validate! validate_locale! validate_retry_after! validate_webhook_url! end |