From 0ae6377b1aa3021103f1d961988065523b11011e Mon Sep 17 00:00:00 2001 From: Vladimir Kochnev Date: Tue, 2 Aug 2022 20:34:13 +0300 Subject: [PATCH] Use rb_define_private_method for Session methods --- ext/patron/session_ext.c | 6 +++--- lib/patron/session.rb | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/patron/session_ext.c b/ext/patron/session_ext.c index 3063aea..1cbe0ca 100644 --- a/ext/patron/session_ext.c +++ b/ext/patron/session_ext.c @@ -966,11 +966,11 @@ void Init_session_ext() { rb_define_singleton_method(cSession, "unescape", session_unescape, 1); rb_define_method(cSession, "unescape", session_unescape, 1); - rb_define_method(cSession, "handle_request", session_handle_request, 1); + rb_define_private_method(cSession, "handle_request", session_handle_request, 1); rb_define_method(cSession, "reset", session_interrupt, 0); rb_define_method(cSession, "interrupt", session_interrupt, 0); - rb_define_method(cSession, "add_cookie_file", add_cookie_file, 1); - rb_define_method(cSession, "set_debug_file", set_debug_file, 1); + rb_define_private_method(cSession, "add_cookie_file", add_cookie_file, 1); + rb_define_private_method(cSession, "set_debug_file", set_debug_file, 1); rb_define_alias(cSession, "urlencode", "escape"); rb_define_alias(cSession, "urldecode", "unescape"); diff --git a/lib/patron/session.rb b/lib/patron/session.rb index bcdaf9e..c7d9649 100644 --- a/lib/patron/session.rb +++ b/lib/patron/session.rb @@ -103,8 +103,6 @@ class Session # @see low_speed_time attr_accessor :low_speed_limit - private :handle_request, :add_cookie_file, :set_debug_file - # @return [#call, nil] callable object that will be called with 4 arguments # during request/response execution - `dltotal`, `dlnow`, `ultotal`, `ulnow`. # All these arguments are in bytes.