Jldrill Git C0 Coverage Information - RCov

lib/jldrill/model/items/JWord.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/jldrill/model/items/JWord.rb 53 37
83.02%
75.68%

Key

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.

Coverage Details

1 # -*- coding: utf-8 -*-
2 
3 require 'jldrill/model/items/ItemFactory'
4 
5 module JLDrill
6 
7     # A JWord is a Japanese Word in a Japanese to English dictionary.
8     # It has a reference to a DictionaryLocation and may
9     # have a cached Meaning
10 	class JWord
11         attr_reader :kanji, :reading, :dictionary, :position, :itemType,
12             :relevance
13         attr_writer :kanji, :reading, :dictionary, :position,
14             :relevance
15 
16         def initialize
17             @kanji = ""
18             @reading = ""
19             @dictionary = nil
20             @position = -1
21             @itemType = ItemFactory::find(self.class)
22             @vocab = nil
23             @relevance = 0 
24         end
25 
26         # The JWord is valid if there is a reading.  There doesn't need to
27         # be a kanji
28         def valid?
29             return !@reading.empty?
30         end
31 
32         def toVocab
33             if @vocab.nil?
34                 @vocab = @dictionary.getVocab(@position)
35             end
36             return @vocab
37         end
38 
39         def toMeaning
40             @meaning = @dictionary.getMeaning(@position)
41             return @meaning
42         end
43 
44         def to_s
45             return @dictionary.lines[@position]
46         end
47 
48         def startsWith?(key)
49             return @reading.start_with?(key) || @kanji.start_with?(key)
50         end
51     end
52 end
53 

Generated on Mon May 23 16:17:46 +0900 2011 with rcov 0.9.8