Class: Emma::Report::Coverage
- Inherits:
-
Object
- Object
- Emma::Report::Coverage
- Defined in:
- lib/emma/report.rb
Instance Attribute Summary collapse
-
#covered ⇒ Object
readonly
Returns the value of attribute covered.
-
#percent ⇒ Object
readonly
Returns the value of attribute percent.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #as_json(opts = nil) ⇒ Object
-
#initialize(percent, covered, total) ⇒ Coverage
constructor
A new instance of Coverage.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(percent, covered, total) ⇒ Coverage
Returns a new instance of Coverage.
137 138 139 |
# File 'lib/emma/report.rb', line 137 def initialize(percent, covered, total) @percent, @covered, @total = percent, covered, total end |
Instance Attribute Details
#covered ⇒ Object (readonly)
Returns the value of attribute covered.
135 136 137 |
# File 'lib/emma/report.rb', line 135 def covered @covered end |
#percent ⇒ Object (readonly)
Returns the value of attribute percent.
135 136 137 |
# File 'lib/emma/report.rb', line 135 def percent @percent end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
135 136 137 |
# File 'lib/emma/report.rb', line 135 def total @total end |
Instance Method Details
#as_json(opts = nil) ⇒ Object
141 142 143 144 145 146 147 |
# File 'lib/emma/report.rb', line 141 def as_json(opts = nil) { :percent => @percent, :covered => @covered, :total => @total } end |
#to_json(*args) ⇒ Object
149 150 151 |
# File 'lib/emma/report.rb', line 149 def to_json(*args) as_json.to_json(*args) end |