Class: RubyProf::AbstractPrinter
- Inherits:
-
Object
- Object
- RubyProf::AbstractPrinter
- Defined in:
- lib/ruby-prof/abstract_printer.rb
Direct Known Subclasses
CallStackPrinter, CallTreePrinter, DotPrinter, FlatPrinter, GraphHtmlPrinter, GraphPrinter
Instance Method Summary collapse
-
#initialize(result) ⇒ AbstractPrinter
constructor
A new instance of AbstractPrinter.
- #method_name(method) ⇒ Object
- #min_percent ⇒ Object
- #print_file ⇒ Object
-
#setup_options(options = {}) ⇒ Object
Specify print options.
Constructor Details
#initialize(result) ⇒ AbstractPrinter
Returns a new instance of AbstractPrinter.
3 4 5 6 7 |
# File 'lib/ruby-prof/abstract_printer.rb', line 3 def initialize(result) @result = result @output = nil @options = {} end |
Instance Method Details
#method_name(method) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/ruby-prof/abstract_printer.rb', line 33 def method_name(method) name = method.full_name if print_file name += " (#{method.source_file}:#{method.line}}" end name end |
#min_percent ⇒ Object
25 26 27 |
# File 'lib/ruby-prof/abstract_printer.rb', line 25 def min_percent @options[:min_percent] || 0 end |
#print_file ⇒ Object
29 30 31 |
# File 'lib/ruby-prof/abstract_printer.rb', line 29 def print_file @options[:print_file] || false end |
#setup_options(options = {}) ⇒ Object
Specify print options.
options - Hash table
:min_percent - Number 0 to 100 that specifes the minimum
%self (the methods self time divided by the
overall total time) that a method must take
for it to be printed out in the report.
Default value is 0.
:print_file - True or false. Specifies if a method's source
file should be printed. Default value if false.
21 22 23 |
# File 'lib/ruby-prof/abstract_printer.rb', line 21 def ( = {}) @options = end |