module Representable::Pipeline::Debug
Public Instance Methods
_inspect_function(func)
click to toggle source
prints SkipParse instead of <Proc>. i know, i can make this better, but not now.
# File lib/representable/debug.rb, line 70 def _inspect_function(func) return func.extend(Pipeline::Debug).inspect if func.is_a?(Collect) return func unless func.is_a?(Proc) File.readlines(func.source_location[0])[func.source_location[1]-1].match(/^\s+(\w+)/)[1] end
call(input, options)
click to toggle source
Calls superclass method
# File lib/representable/debug.rb, line 47 def call(input, options) puts "Pipeline#call: #{inspect}" puts " input: #{input.inspect}" super end
evaluate(block, memo, options)
click to toggle source
Calls superclass method
# File lib/representable/debug.rb, line 53 def evaluate(block, memo, options) block.extend(Pipeline::Debug) if block.is_a?(Collect) puts " Pipeline : -> #{_inspect_function(block)} " super.tap do |res| puts " Pipeline : result: #{res.inspect}" end end
inspect()
click to toggle source
# File lib/representable/debug.rb, line 62 def inspect functions = collect do |func| _inspect_function(func) end.join(", ") "#{self.class.to_s.split("::").last}[#{functions}]" end