def Resolve(maybe_proc, context = nil) # rubocop:disable Style/MethodName
      if maybe_proc.respond_to?(:to_proc) && !maybe_proc.instance_of?(Symbol)
        if context
          if maybe_proc.arity > 0
            context.instance_eval(&maybe_proc)
          else
            # In case it's a lambda with zero arity instance_eval fails
            context.instance_exec(&maybe_proc)
          end
        else
          maybe_proc.to_proc.call()
        end
      else
        maybe_proc
      end
    end
def Resolve(maybe_proc, context = nil) # rubocop:disable Style/MethodName
      if maybe_proc.respond_to?(:to_proc) && !maybe_proc.instance_of?(Symbol)
        if context
          if maybe_proc.arity > 0
            context.instance_eval(&maybe_proc)
          else
            # In case it's a lambda with zero arity instance_eval fails
            context.instance_exec(&maybe_proc)
          end
        else
          maybe_proc.to_proc.call()
        end
      else
        maybe_proc
      end
    end
Turn what is maybe a Proc into its result (or itself)

 When input can be either a value or a proc that returns a value,
 this conversion function can be used to resolve the thing to a
 value.

 The proc can be evaluated (instance_evaled) in a certain context,
 or evaluated as a closure.

 @param [Object|Proc] maybe_proc
   A proc or a plain value
 @param [Object] context
   (optional) A context used to instance_eval the proc