Class: Newshound::Configuration
- Inherits:
-
Object
- Object
- Newshound::Configuration
- Defined in:
- lib/newshound/configuration.rb
Constant Summary collapse
- POSITIONS =
%i[top bottom].freeze
Instance Attribute Summary collapse
-
#authorization_block ⇒ Object
Returns the value of attribute authorization_block.
-
#authorized_roles ⇒ Object
Returns the value of attribute authorized_roles.
-
#current_user_method ⇒ Object
Returns the value of attribute current_user_method.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#exception_limit ⇒ Object
Returns the value of attribute exception_limit.
-
#exception_links ⇒ Object
Returns the value of attribute exception_links.
-
#exception_source ⇒ Object
Returns the value of attribute exception_source.
-
#exception_source_config ⇒ Object
Returns the value of attribute exception_source_config.
-
#expired_jobs_threshold ⇒ Object
(also: #failed_jobs_threshold)
Returns the value of attribute expired_jobs_threshold.
-
#job_links ⇒ Object
Returns the value of attribute job_links.
-
#job_source ⇒ Object
Returns the value of attribute job_source.
-
#position ⇒ Object
Returns the value of attribute position.
-
#warning_limit ⇒ Object
Returns the value of attribute warning_limit.
-
#warning_links ⇒ Object
Returns the value of attribute warning_links.
-
#warning_source ⇒ Object
Returns the value of attribute warning_source.
Instance Method Summary collapse
-
#authorize_with(&block) ⇒ Object
Allow custom authorization logic.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/newshound/configuration.rb', line 21 def initialize @exception_limit = 10 @enabled = true @authorized_roles = [:developer, :super_user] @current_user_method = :current_user @authorization_block = nil @exception_source = :exception_track @exception_source_config = {} @warning_source = nil @warning_limit = 10 @job_source = nil @expired_jobs_threshold = 0 @exception_links = {} @job_links = {} @warning_links = {} @position = :top end |
Instance Attribute Details
#authorization_block ⇒ Object
Returns the value of attribute authorization_block.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def @authorization_block end |
#authorized_roles ⇒ Object
Returns the value of attribute authorized_roles.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def @authorized_roles end |
#current_user_method ⇒ Object
Returns the value of attribute current_user_method.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def current_user_method @current_user_method end |
#enabled ⇒ Object
Returns the value of attribute enabled.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def enabled @enabled end |
#exception_limit ⇒ Object
Returns the value of attribute exception_limit.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def exception_limit @exception_limit end |
#exception_links ⇒ Object
Returns the value of attribute exception_links.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def exception_links @exception_links end |
#exception_source ⇒ Object
Returns the value of attribute exception_source.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def exception_source @exception_source end |
#exception_source_config ⇒ Object
Returns the value of attribute exception_source_config.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def exception_source_config @exception_source_config end |
#expired_jobs_threshold ⇒ Object Also known as: failed_jobs_threshold
Returns the value of attribute expired_jobs_threshold.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def expired_jobs_threshold @expired_jobs_threshold end |
#job_links ⇒ Object
Returns the value of attribute job_links.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def job_links @job_links end |
#job_source ⇒ Object
Returns the value of attribute job_source.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def job_source @job_source end |
#position ⇒ Object
Returns the value of attribute position.
19 20 21 |
# File 'lib/newshound/configuration.rb', line 19 def position @position end |
#warning_limit ⇒ Object
Returns the value of attribute warning_limit.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def warning_limit @warning_limit end |
#warning_links ⇒ Object
Returns the value of attribute warning_links.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def warning_links @warning_links end |
#warning_source ⇒ Object
Returns the value of attribute warning_source.
7 8 9 |
# File 'lib/newshound/configuration.rb', line 7 def warning_source @warning_source end |
Instance Method Details
#authorize_with(&block) ⇒ Object
Allow custom authorization logic
50 51 52 |
# File 'lib/newshound/configuration.rb', line 50 def (&block) @authorization_block = block end |
#valid? ⇒ Boolean
54 55 56 |
# File 'lib/newshound/configuration.rb', line 54 def valid? enabled end |