Class: Xcov::Function
Instance Attribute Summary
Attributes inherited from Base
#coverage, #coverage_color, #displayable_coverage, #id, #name
Class Method Summary collapse
-
.map(dictionary) ⇒ Object
Class methods.
Instance Method Summary collapse
- #html_value ⇒ Object
-
#initialize(name, coverage) ⇒ Function
constructor
A new instance of Function.
- #json_value ⇒ Object
- #print_description ⇒ Object
Methods inherited from Base
#coverage_emoji, #create_coverage_color, #create_displayable_coverage, create_id, #create_summary, template
Constructor Details
#initialize(name, coverage) ⇒ Function
Returns a new instance of Function.
6 7 8 9 10 11 |
# File 'lib/xcov/model/function.rb', line 6 def initialize(name, coverage) @name = CGI::escapeHTML(name) @coverage = coverage @displayable_coverage = self.create_displayable_coverage @coverage_color = self.create_coverage_color end |
Class Method Details
Instance Method Details
#html_value ⇒ Object
17 18 19 |
# File 'lib/xcov/model/function.rb', line 17 def html_value Function.template("function").result(binding) end |
#json_value ⇒ Object
21 22 23 24 25 26 |
# File 'lib/xcov/model/function.rb', line 21 def json_value { "name" => @name, "coverage" => @coverage, } end |
#print_description ⇒ Object
13 14 15 |
# File 'lib/xcov/model/function.rb', line 13 def print_description puts "\t\t\t#{@name} (#{@displayable_coverage})" end |