Class: RenderGuardian::Budget
- Inherits:
-
Object
- Object
- RenderGuardian::Budget
- Defined in:
- lib/render_guardian/budget.rb
Constant Summary collapse
- DEFAULTS =
{ max_template_time_ms: 100, max_partial_time_ms: 50, max_helper_time_ms: 20, max_db_queries_per_partial: 3, n_plus_one_threshold: 5 }.freeze
Instance Attribute Summary collapse
-
#limits ⇒ Object
readonly
Returns the value of attribute limits.
Instance Method Summary collapse
-
#initialize(limits = {}) ⇒ Budget
constructor
A new instance of Budget.
- #limit_for(key) ⇒ Object
Constructor Details
Instance Attribute Details
#limits ⇒ Object (readonly)
Returns the value of attribute limits.
13 14 15 |
# File 'lib/render_guardian/budget.rb', line 13 def limits @limits end |
Instance Method Details
#limit_for(key) ⇒ Object
19 20 21 |
# File 'lib/render_guardian/budget.rb', line 19 def limit_for(key) @limits[key.to_sym] end |