lib/peeky/method_info.rb
# Infer default paramater values
#
# WARNING: Unit test coverage went from .1 seconds to 30-40 seconds
# when I first introduced this method.
#
# I now only call TracePoint if I have optional parameters to be inferred.
#
# The tests are now down to 5 seconds, but it highlights the cost of use
# TracePoint.
Infer default paramater values
WARNING: Unit test coverage went from .1 seconds to 30-40 seconds
when I first introduced this method.

I now only call TracePoint if I have optional parameters to be inferred.

The tests are now down to 5 seconds, but it highlights the cost of use
TracePoint.
Infer default paramater values WARNING : Unit test coverage went from . 1 seconds to 30 - 40 seconds when I first introduced this method . I now only call TracePoint if I have optional parameters to be inferred . The tests are now down to 5 seconds but it highlights the cost of use TracePoint .
def infer_default_paramaters
      class_name = @implementation_type == :class_method ? @target_instance.class.name : nil
      minimalist_method = Peeky::Renderer::MethodCallMinimumParamsRender.new(self, class_name: class_name).render
      return if minimalist_method.end_with?('=')
      return unless optional?
      tracer.enable do
        @target_instance.instance_eval(minimalist_method)       if @implementation_type == :method
        @target_instance.class.instance_eval(minimalist_method) if @implementation_type == :class_method
      rescue StandardError => e
        puts e.message
      end
    end
def infer_default_paramaters class_name = @implementation_type == :class_method ? @target_instance . class . name : nil minimalist_method = Peeky :: Renderer :: MethodCallMinimumParamsRender . new ( self , class_name : class_name ) . render return if minimalist_method . end_with? ( '=' ) return unless optional? tracer . enable do @target_instance . instance_eval ( minimalist_method ) if @implementation_type == :method @target_instance . class . instance_eval ( minimalist_method ) if @implementation_type == :class_method rescue StandardError => e puts e . message end end
Infer default paramater values
WARNING: Unit test coverage went from .1 seconds to 30-40 seconds
when I first introduced this method.
Infer default paramater values WARNING : Unit test coverage went from . 1 seconds to 30 - 40 seconds when I first introduced this method .
# TODO: minimalist method should be able to handle class methods # just print the error for now, we are only attempting to capture the # first call, any errors inside the call cannot be dealt with and should # not be re-raised