@@ -13,20 +13,35 @@ class IMAP
13
13
# *NOTE:* Updates to config objects are not synchronized for thread-safety.
14
14
#
15
15
class Config
16
+ # The default config, which is hardcoded and frozen.
17
+ def self . default ; @default end
18
+
16
19
include AttrAccessors
17
20
18
21
# The debug mode (boolean)
22
+ #
23
+ # | Starting with version | The default value is |
24
+ # |-----------------------|----------------------|
25
+ # | _original_ | +false+ |
19
26
attr_accessor :debug
20
27
alias debug? debug
21
28
22
29
# Seconds to wait until a connection is opened.
23
30
#
24
31
# If the IMAP object cannot open a connection within this time,
25
32
# it raises a Net::OpenTimeout exception. See Net::IMAP.new.
33
+ #
34
+ # | Starting with version | The default value is |
35
+ # |-----------------------|----------------------|
36
+ # | _original_ | +30+ seconds |
26
37
attr_accessor :open_timeout
27
38
28
39
# Seconds to wait until an IDLE response is received, after
29
40
# the client asks to leave the IDLE state. See Net::IMAP#idle_done.
41
+ #
42
+ # | Starting with version | The default value is |
43
+ # |-----------------------|----------------------|
44
+ # | _original_ | +5+ seconds |
30
45
attr_accessor :idle_response_timeout
31
46
32
47
# Creates a new config object and initialize its attribute with +attrs+.
@@ -38,6 +53,12 @@ def initialize(**attrs)
38
53
yield self if block_given?
39
54
end
40
55
56
+ @default = new (
57
+ debug : false ,
58
+ open_timeout : 30 ,
59
+ idle_response_timeout : 5 ,
60
+ ) . freeze
61
+
41
62
end
42
63
end
43
64
end
0 commit comments