Class: Silhouette::MethodFinder::MethodPosition
- Inherits:
-
Object
- Object
- Silhouette::MethodFinder::MethodPosition
- Defined in:
- lib/silhouette/finder.rb
Instance Attribute Summary collapse
-
#first_line ⇒ Object
Returns the value of attribute first_line.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#last_line ⇒ Object
Returns the value of attribute last_line.
-
#loc ⇒ Object
Returns the value of attribute loc.
-
#misses ⇒ Object
Returns the value of attribute misses.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #coverage ⇒ Object
-
#initialize(name, klass) ⇒ MethodPosition
constructor
A new instance of MethodPosition.
- #total ⇒ Object
Constructor Details
#initialize(name, klass) ⇒ MethodPosition
Returns a new instance of MethodPosition.
6 7 8 9 10 11 |
# File 'lib/silhouette/finder.rb', line 6 def initialize(name, klass) @name = name @klass = klass @misses = 0 @loc = 0 end |
Instance Attribute Details
#first_line ⇒ Object
Returns the value of attribute first_line.
17 18 19 |
# File 'lib/silhouette/finder.rb', line 17 def first_line @first_line end |
#klass ⇒ Object
Returns the value of attribute klass.
17 18 19 |
# File 'lib/silhouette/finder.rb', line 17 def klass @klass end |
#last_line ⇒ Object
Returns the value of attribute last_line.
17 18 19 |
# File 'lib/silhouette/finder.rb', line 17 def last_line @last_line end |
#loc ⇒ Object
Returns the value of attribute loc.
17 18 19 |
# File 'lib/silhouette/finder.rb', line 17 def loc @loc end |
#misses ⇒ Object
Returns the value of attribute misses.
17 18 19 |
# File 'lib/silhouette/finder.rb', line 17 def misses @misses end |
#name ⇒ Object
Returns the value of attribute name.
17 18 19 |
# File 'lib/silhouette/finder.rb', line 17 def name @name end |
Instance Method Details
#coverage ⇒ Object
19 20 21 22 |
# File 'lib/silhouette/finder.rb', line 19 def coverage loc_hit = @loc - @misses ((loc_hit / @loc.to_f) * 100).to_i end |
#total ⇒ Object
13 14 15 |
# File 'lib/silhouette/finder.rb', line 13 def total @last_line - @first_line end |