Class: BenchmarkToJs::Configuration
- Inherits:
-
Object
- Object
- BenchmarkToJs::Configuration
- Defined in:
- lib/benchmark_to_js/configuration.rb
Instance Attribute Summary collapse
-
#orange_threshold ⇒ Object
Returns the value of attribute orange_threshold.
-
#pretty ⇒ Object
Returns the value of attribute pretty.
-
#red_threshold ⇒ Object
Returns the value of attribute red_threshold.
-
#run_in_environments ⇒ Object
Returns the value of attribute run_in_environments.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #run? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 |
# File 'lib/benchmark_to_js/configuration.rb', line 5 def initialize self.run_in_environments = [:development] self.pretty = true self.orange_threshold = 100 self.red_threshold = 500 end |
Instance Attribute Details
#orange_threshold ⇒ Object
Returns the value of attribute orange_threshold.
3 4 5 |
# File 'lib/benchmark_to_js/configuration.rb', line 3 def orange_threshold @orange_threshold end |
#pretty ⇒ Object
Returns the value of attribute pretty.
3 4 5 |
# File 'lib/benchmark_to_js/configuration.rb', line 3 def pretty @pretty end |
#red_threshold ⇒ Object
Returns the value of attribute red_threshold.
3 4 5 |
# File 'lib/benchmark_to_js/configuration.rb', line 3 def red_threshold @red_threshold end |
#run_in_environments ⇒ Object
Returns the value of attribute run_in_environments.
3 4 5 |
# File 'lib/benchmark_to_js/configuration.rb', line 3 def run_in_environments @run_in_environments end |
Instance Method Details
#run? ⇒ Boolean
12 13 14 15 16 |
# File 'lib/benchmark_to_js/configuration.rb', line 12 def run? @run ||= begin defined?(Rails) && Array(self.run_in_environments).map(&:to_s).include?(Rails.env) end end |