Class: CodeWeb::TextReport
- Inherits:
-
Object
- Object
- CodeWeb::TextReport
- Defined in:
- lib/code_web/text_report.rb
Instance Attribute Summary collapse
-
#:method_calls(: method_calls) ⇒ Array<MethodCall>
readonly
list of all the method_Calls.
-
#arg_regex ⇒ Object
Returns the value of attribute arg_regex.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#method_calls ⇒ Object
Returns the value of attribute method_calls.
Instance Method Summary collapse
- #arg_regex? ⇒ Boolean
-
#initialize(method_calls, class_map = {}, arg_regex = nil, out = STDOUT, options = {}) ⇒ TextReport
constructor
A new instance of TextReport.
- #methods_by_name ⇒ Object
- #report ⇒ Object
Constructor Details
#initialize(method_calls, class_map = {}, arg_regex = nil, out = STDOUT, options = {}) ⇒ TextReport
Returns a new instance of TextReport.
11 12 13 14 15 16 17 |
# File 'lib/code_web/text_report.rb', line 11 def initialize(method_calls, class_map={}, arg_regex=nil, out=STDOUT, = {}) @method_calls = method_calls @arg_regex = arg_regex @base_url = [:base_url] @url_and_file = [:url_and_file] @out = out end |
Instance Attribute Details
#:method_calls(: method_calls) ⇒ Array<MethodCall> (readonly)
list of all the method_Calls
6 |
# File 'lib/code_web/text_report.rb', line 6 attr_accessor :method_calls |
#arg_regex ⇒ Object
Returns the value of attribute arg_regex.
7 8 9 |
# File 'lib/code_web/text_report.rb', line 7 def arg_regex @arg_regex end |
#base_url ⇒ Object
Returns the value of attribute base_url.
8 9 10 |
# File 'lib/code_web/text_report.rb', line 8 def base_url @base_url end |
#method_calls ⇒ Object
Returns the value of attribute method_calls.
6 7 8 |
# File 'lib/code_web/text_report.rb', line 6 def method_calls @method_calls end |
Instance Method Details
#arg_regex? ⇒ Boolean
9 |
# File 'lib/code_web/text_report.rb', line 9 def arg_regex? ; ! arg_regex.nil? ; end |
#methods_by_name ⇒ Object
40 41 42 |
# File 'lib/code_web/text_report.rb', line 40 def methods_by_name MethodList.group_by(method_calls, :short_method_name) end |
#report ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/code_web/text_report.rb', line 19 def report methods_by_name.each do |methods| @out.puts "---- #{methods.name} ----" methods.group_by(:signature, arg_regex).each do |methods_with_signature| if arg_regex? @out.puts " --> #{arg_regex.inspect}=#{methods_with_signature.name}" else @out.puts " --> #{methods_with_signature.name}" end methods_with_signature.each_with_index do |method, i| @out.puts @out.puts method.signature @out.puts "#{method.filename}:#{method.line}" end @out.puts @out.puts end @out.puts end end |