| Name | Total Lines | Lines of Code | Total Coverage | Code Coverage | 
|---|---|---|---|---|
| lib/asir/coder/json.rb | 24 | 17 | 100.00% | 100.00% | 
Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.
| 1 require 'asir' | 
| 2 | 
| 3 gem 'json' | 
| 4 require 'json/ext' | 
| 5 | 
| 6 module ASIR | 
| 7 class Coder | 
| 8 # Note: Symbols are not handled. | 
| 9 # The actual JSON expression is wrapped with an Array. | 
| 10 class JSON < self | 
| 11 def _encode obj | 
| 12 [ obj ].to_json | 
| 13 end | 
| 14 | 
| 15 def _decode obj | 
| 16 parser = ::JSON.parser.new(obj) | 
| 17 ary = parser.parse | 
| 18 ary.first | 
| 19 end | 
| 20 end # class | 
| 21 end # class | 
| 22 end # module | 
| 23 | 
| 24 | 
Generated on Fri Jan 27 17:37:46 -0600 2012 with rcov 0.9.8