Class: Covered::Policy
Instance Attribute Summary collapse
-
#summary_class ⇒ Object
Returns the value of attribute summary_class.
-
#threshold ⇒ Object
Returns the value of attribute threshold.
Attributes inherited from Wrapper
Instance Method Summary collapse
- #cache! ⇒ Object
- #capture ⇒ Object
- #disable ⇒ Object
- #enable ⇒ Object
- #freeze ⇒ Object
- #include(*args) ⇒ Object
-
#initialize ⇒ Policy
constructor
A new instance of Policy.
- #only(*args) ⇒ Object
- #print_summary(*args) ⇒ Object
- #root(*args) ⇒ Object
- #skip(*args) ⇒ Object
- #source(*args) ⇒ Object
- #summary(*args) ⇒ Object
Methods inherited from Wrapper
Constructor Details
#initialize ⇒ Policy
Returns a new instance of Policy.
38 39 40 41 42 43 |
# File 'lib/covered/policy.rb', line 38 def initialize super(Files.new) @threshold = 1.0 @summary_class = PartialSummary end |
Instance Attribute Details
#summary_class ⇒ Object
Returns the value of attribute summary_class.
45 46 47 |
# File 'lib/covered/policy.rb', line 45 def summary_class @summary_class end |
#threshold ⇒ Object
Returns the value of attribute threshold.
46 47 48 |
# File 'lib/covered/policy.rb', line 46 def threshold @threshold end |
Instance Method Details
#cache! ⇒ Object
77 78 79 |
# File 'lib/covered/policy.rb', line 77 def cache! @output = Cache.new(@output) end |
#capture ⇒ Object
81 82 83 |
# File 'lib/covered/policy.rb', line 81 def capture @capture ||= Capture.new(@output) end |
#disable ⇒ Object
89 90 91 |
# File 'lib/covered/policy.rb', line 89 def disable capture.disable end |
#enable ⇒ Object
85 86 87 |
# File 'lib/covered/policy.rb', line 85 def enable capture.enable end |
#freeze ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/covered/policy.rb', line 48 def freeze return if frozen? capture summary(threshold: @threshold) super end |
#include(*args) ⇒ Object
61 62 63 |
# File 'lib/covered/policy.rb', line 61 def include(*args) @output = Include.new(@output, *args) end |
#only(*args) ⇒ Object
69 70 71 |
# File 'lib/covered/policy.rb', line 69 def only(*args) @output = Only.new(@output, *args) end |
#print_summary(*args) ⇒ Object
97 98 99 |
# File 'lib/covered/policy.rb', line 97 def print_summary(*args) summary.print_summary(*args) end |
#root(*args) ⇒ Object
73 74 75 |
# File 'lib/covered/policy.rb', line 73 def root(*args) @output = Root.new(@output, *args) end |
#skip(*args) ⇒ Object
65 66 67 |
# File 'lib/covered/policy.rb', line 65 def skip(*args) @output = Skip.new(@output, *args) end |
#source(*args) ⇒ Object
57 58 59 |
# File 'lib/covered/policy.rb', line 57 def source(*args) @output = Source.new(@output, *args) end |
#summary(*args) ⇒ Object
93 94 95 |
# File 'lib/covered/policy.rb', line 93 def summary(*args) @summary ||= @summary_class.new(@output, *args) end |