rbs 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +5 -0
- data/CHANGELOG.md +23 -0
- data/README.md +6 -1
- data/core/array.rbs +2866 -1086
- data/core/basic_object.rbs +150 -30
- data/core/binding.rbs +33 -0
- data/core/builtin.rbs +4 -4
- data/core/class.rbs +43 -5
- data/core/comparable.rbs +57 -0
- data/core/complex.rbs +170 -4
- data/core/constants.rbs +51 -0
- data/core/deprecated.rbs +7 -0
- data/core/dir.rbs +305 -20
- data/core/encoding.rbs +472 -77
- data/core/enumerable.rbs +2173 -234
- data/core/enumerator.rbs +448 -182
- data/core/env.rbs +448 -1
- data/core/errno.rbs +1 -10
- data/core/errors.rbs +152 -2
- data/core/exception.rbs +201 -127
- data/core/false_class.rbs +27 -0
- data/core/fiber.rbs +118 -37
- data/core/fiber_error.rbs +8 -9
- data/core/file.rbs +1059 -139
- data/core/file_test.rbs +287 -32
- data/core/float.rbs +776 -300
- data/core/gc.rbs +185 -34
- data/core/global_variables.rbs +5 -1
- data/core/hash.rbs +1582 -649
- data/core/integer.rbs +974 -204
- data/core/io/buffer.rbs +710 -0
- data/core/io/wait.rbs +29 -8
- data/core/io.rbs +2438 -417
- data/core/kernel.rbs +2315 -316
- data/core/marshal.rbs +37 -2
- data/core/match_data.rbs +123 -6
- data/core/math.rbs +126 -6
- data/core/method.rbs +226 -102
- data/core/module.rbs +421 -45
- data/core/nil_class.rbs +64 -0
- data/core/numeric.rbs +620 -142
- data/core/object.rbs +453 -81
- data/core/object_space.rbs +92 -2
- data/core/proc.rbs +482 -285
- data/core/process.rbs +443 -34
- data/core/ractor.rbs +232 -9
- data/core/random.rbs +151 -52
- data/core/range.rbs +885 -160
- data/core/rational.rbs +122 -6
- data/core/rb_config.rbs +14 -4
- data/core/refinement.rbs +44 -0
- data/core/regexp.rbs +156 -14
- data/core/ruby_vm.rbs +42 -3
- data/core/signal.rbs +78 -39
- data/core/string.rbs +2123 -567
- data/core/string_io.rbs +204 -0
- data/core/struct.rbs +283 -28
- data/core/symbol.rbs +304 -30
- data/core/thread.rbs +1288 -688
- data/core/thread_group.rbs +66 -10
- data/core/time.rbs +643 -217
- data/core/trace_point.rbs +100 -12
- data/core/true_class.rbs +24 -0
- data/core/unbound_method.rbs +73 -7
- data/core/warning.rbs +37 -12
- data/docs/CONTRIBUTING.md +40 -34
- data/docs/stdlib.md +3 -102
- data/lib/rbs/annotate/annotations.rb +197 -0
- data/lib/rbs/annotate/formatter.rb +80 -0
- data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
- data/lib/rbs/annotate/rdoc_source.rb +120 -0
- data/lib/rbs/annotate.rb +6 -0
- data/lib/rbs/cli.rb +45 -1
- data/lib/rbs/definition_builder.rb +5 -1
- data/lib/rbs/location_aux.rb +12 -0
- data/lib/rbs/prototype/rb.rb +12 -0
- data/lib/rbs/version.rb +1 -1
- data/sig/annotate/annotations.rbs +102 -0
- data/sig/annotate/formatter.rbs +24 -0
- data/sig/annotate/rdoc_annotater.rbs +82 -0
- data/sig/annotate/rdoc_source.rbs +30 -0
- data/sig/cli.rbs +2 -0
- data/sig/collection/{collections.rbs → sources.rbs} +0 -0
- data/sig/location.rbs +6 -0
- data/sig/method_types.rbs +5 -1
- data/sig/polyfill.rbs +78 -0
- data/stdlib/abbrev/0/abbrev.rbs +6 -0
- data/stdlib/abbrev/0/array.rbs +26 -0
- data/stdlib/base64/0/base64.rbs +31 -0
- data/stdlib/benchmark/0/benchmark.rbs +74 -3
- data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
- data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
- data/stdlib/cgi/0/core.rbs +59 -0
- data/stdlib/coverage/0/coverage.rbs +164 -2
- data/stdlib/csv/0/csv.rbs +2862 -398
- data/stdlib/date/0/date.rbs +483 -25
- data/stdlib/date/0/date_time.rbs +187 -12
- data/stdlib/dbm/0/dbm.rbs +152 -17
- data/stdlib/digest/0/digest.rbs +146 -0
- data/stdlib/erb/0/erb.rbs +65 -245
- data/stdlib/fiber/0/fiber.rbs +73 -91
- data/stdlib/fileutils/0/fileutils.rbs +301 -1
- data/stdlib/find/0/find.rbs +9 -0
- data/stdlib/forwardable/0/forwardable.rbs +65 -1
- data/stdlib/io-console/0/io-console.rbs +227 -15
- data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
- data/stdlib/json/0/json.rbs +1146 -144
- data/stdlib/logger/0/formatter.rbs +24 -0
- data/stdlib/logger/0/log_device.rbs +64 -0
- data/stdlib/logger/0/logger.rbs +165 -13
- data/stdlib/logger/0/period.rbs +10 -0
- data/stdlib/logger/0/severity.rbs +26 -0
- data/stdlib/monitor/0/monitor.rbs +163 -0
- data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
- data/stdlib/net-http/0/net-http.rbs +1492 -683
- data/stdlib/nkf/0/nkf.rbs +372 -0
- data/stdlib/objspace/0/objspace.rbs +149 -90
- data/stdlib/openssl/0/openssl.rbs +8108 -71
- data/stdlib/optparse/0/optparse.rbs +487 -19
- data/stdlib/pathname/0/pathname.rbs +425 -124
- data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
- data/stdlib/prime/0/integer-extension.rbs +20 -2
- data/stdlib/prime/0/prime.rbs +88 -21
- data/stdlib/pstore/0/pstore.rbs +102 -0
- data/stdlib/pty/0/pty.rbs +64 -14
- data/stdlib/resolv/0/resolv.rbs +420 -31
- data/stdlib/rubygems/0/basic_specification.rbs +4 -1
- data/stdlib/rubygems/0/config_file.rbs +33 -1
- data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
- data/stdlib/rubygems/0/installer.rbs +13 -1
- data/stdlib/rubygems/0/path_support.rbs +4 -1
- data/stdlib/rubygems/0/platform.rbs +5 -1
- data/stdlib/rubygems/0/request_set.rbs +44 -2
- data/stdlib/rubygems/0/requirement.rbs +65 -2
- data/stdlib/rubygems/0/rubygems.rbs +407 -0
- data/stdlib/rubygems/0/source_list.rbs +13 -0
- data/stdlib/rubygems/0/specification.rbs +21 -1
- data/stdlib/rubygems/0/stream_ui.rbs +3 -1
- data/stdlib/rubygems/0/uninstaller.rbs +8 -1
- data/stdlib/rubygems/0/version.rbs +60 -157
- data/stdlib/securerandom/0/securerandom.rbs +44 -0
- data/stdlib/set/0/set.rbs +420 -106
- data/stdlib/shellwords/0/shellwords.rbs +55 -77
- data/stdlib/singleton/0/singleton.rbs +20 -0
- data/stdlib/socket/0/addrinfo.rbs +210 -9
- data/stdlib/socket/0/basic_socket.rbs +103 -11
- data/stdlib/socket/0/ip_socket.rbs +31 -9
- data/stdlib/socket/0/socket.rbs +586 -38
- data/stdlib/socket/0/tcp_server.rbs +22 -2
- data/stdlib/socket/0/tcp_socket.rbs +12 -1
- data/stdlib/socket/0/udp_socket.rbs +25 -2
- data/stdlib/socket/0/unix_server.rbs +22 -2
- data/stdlib/socket/0/unix_socket.rbs +45 -5
- data/stdlib/strscan/0/string_scanner.rbs +210 -9
- data/stdlib/tempfile/0/tempfile.rbs +58 -10
- data/stdlib/time/0/time.rbs +208 -116
- data/stdlib/timeout/0/timeout.rbs +10 -0
- data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
- data/stdlib/tsort/0/cyclic.rbs +1 -0
- data/stdlib/tsort/0/interfaces.rbs +1 -0
- data/stdlib/tsort/0/tsort.rbs +42 -0
- data/stdlib/uri/0/common.rbs +57 -8
- data/stdlib/uri/0/file.rbs +55 -109
- data/stdlib/uri/0/ftp.rbs +6 -3
- data/stdlib/uri/0/generic.rbs +556 -327
- data/stdlib/uri/0/http.rbs +26 -115
- data/stdlib/uri/0/https.rbs +8 -102
- data/stdlib/uri/0/ldap.rbs +143 -137
- data/stdlib/uri/0/ldaps.rbs +8 -102
- data/stdlib/uri/0/mailto.rbs +3 -0
- data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
- data/stdlib/uri/0/ws.rbs +6 -3
- data/stdlib/uri/0/wss.rbs +5 -3
- data/stdlib/yaml/0/dbm.rbs +151 -87
- data/stdlib/yaml/0/store.rbs +6 -0
- data/stdlib/zlib/0/zlib.rbs +90 -31
- metadata +17 -5
- data/lib/rbs/location.rb +0 -221
data/core/method.rbs
CHANGED
@@ -1,79 +1,116 @@
|
|
1
|
+
# <!-- rdoc-file=proc.c -->
|
2
|
+
# Method objects are created by Object#method, and are associated with a
|
3
|
+
# particular object (not just with a class). They may be used to invoke the
|
4
|
+
# method within the object, and as a block associated with an iterator. They
|
5
|
+
# may also be unbound from one object (creating an UnboundMethod) and bound to
|
6
|
+
# another.
|
7
|
+
#
|
8
|
+
# class Thing
|
9
|
+
# def square(n)
|
10
|
+
# n*n
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
# thing = Thing.new
|
14
|
+
# meth = thing.method(:square)
|
15
|
+
#
|
16
|
+
# meth.call(9) #=> 81
|
17
|
+
# [ 1, 2, 3 ].collect(&meth) #=> [1, 4, 9]
|
18
|
+
#
|
19
|
+
# [ 1, 2, 3 ].each(&method(:puts)) #=> prints 1, 2, 3
|
20
|
+
#
|
21
|
+
# require 'date'
|
22
|
+
# %w[2017-03-01 2017-03-02].collect(&Date.method(:parse))
|
23
|
+
# #=> [#<Date: 2017-03-01 ((2457814j,0s,0n),+0s,2299161j)>, #<Date: 2017-03-02 ((2457815j,0s,0n),+0s,2299161j)>]
|
24
|
+
#
|
1
25
|
class Method < Object
|
2
|
-
#
|
26
|
+
# <!--
|
27
|
+
# rdoc-file=proc.c
|
28
|
+
# - meth.to_proc -> proc
|
29
|
+
# -->
|
30
|
+
# Returns a Proc object corresponding to this method.
|
31
|
+
#
|
3
32
|
def to_proc: () -> Proc
|
4
33
|
|
5
|
-
#
|
6
|
-
#
|
34
|
+
# <!--
|
35
|
+
# rdoc-file=proc.c
|
36
|
+
# - meth.call(args, ...) -> obj
|
37
|
+
# -->
|
38
|
+
# Invokes the *meth* with the specified arguments, returning the method's return
|
39
|
+
# value.
|
40
|
+
#
|
41
|
+
# m = 12.method("+")
|
42
|
+
# m.call(3) #=> 15
|
43
|
+
# m.call(20) #=> 32
|
7
44
|
#
|
8
|
-
# ```ruby
|
9
|
-
# m = 12.method("+")
|
10
|
-
# m.call(3) #=> 15
|
11
|
-
# m.call(20) #=> 32
|
12
|
-
# ```
|
13
45
|
def call: (*untyped args) -> untyped
|
14
46
|
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
47
|
+
# <!--
|
48
|
+
# rdoc-file=proc.c
|
49
|
+
# - meth << g -> a_proc
|
50
|
+
# -->
|
51
|
+
# Returns a proc that is the composition of this method and the given *g*. The
|
52
|
+
# returned proc takes a variable number of arguments, calls *g* with them then
|
53
|
+
# calls this method with the result.
|
18
54
|
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
55
|
+
# def f(x)
|
56
|
+
# x * x
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# f = self.method(:f)
|
60
|
+
# g = proc {|x| x + x }
|
61
|
+
# p (f << g).call(2) #=> 16
|
23
62
|
#
|
24
|
-
# f = self.method(:f)
|
25
|
-
# g = proc {|x| x + x }
|
26
|
-
# p (f << g).call(2) #=> 16
|
27
|
-
# ```
|
28
63
|
def <<: (Proc g) -> Proc
|
29
64
|
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
65
|
+
# <!-- rdoc-file=proc.c -->
|
66
|
+
# Invokes the *meth* with the specified arguments, returning the method's return
|
67
|
+
# value.
|
33
68
|
#
|
34
|
-
#
|
35
|
-
#
|
69
|
+
# m = 12.method("+")
|
70
|
+
# m.call(3) #=> 15
|
71
|
+
# m.call(20) #=> 32
|
36
72
|
#
|
37
|
-
# case 1373
|
38
|
-
# when Prime.method(:prime?)
|
39
|
-
# # ...
|
40
|
-
# end
|
41
|
-
# ```
|
42
73
|
alias === call
|
43
74
|
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
75
|
+
# <!--
|
76
|
+
# rdoc-file=proc.c
|
77
|
+
# - meth >> g -> a_proc
|
78
|
+
# -->
|
79
|
+
# Returns a proc that is the composition of this method and the given *g*. The
|
80
|
+
# returned proc takes a variable number of arguments, calls this method with
|
81
|
+
# them then calls *g* with the result.
|
47
82
|
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
83
|
+
# def f(x)
|
84
|
+
# x * x
|
85
|
+
# end
|
86
|
+
#
|
87
|
+
# f = self.method(:f)
|
88
|
+
# g = proc {|x| x + x }
|
89
|
+
# p (f >> g).call(2) #=> 8
|
52
90
|
#
|
53
|
-
# f = self.method(:f)
|
54
|
-
# g = proc {|x| x + x }
|
55
|
-
# p (f >> g).call(2) #=> 8
|
56
|
-
# ```
|
57
91
|
def >>: (Proc g) -> Proc
|
58
92
|
|
59
|
-
#
|
60
|
-
# return
|
93
|
+
# <!-- rdoc-file=proc.c -->
|
94
|
+
# Invokes the *meth* with the specified arguments, returning the method's return
|
95
|
+
# value.
|
96
|
+
#
|
97
|
+
# m = 12.method("+")
|
98
|
+
# m.call(3) #=> 15
|
99
|
+
# m.call(20) #=> 32
|
61
100
|
#
|
62
|
-
# ```ruby
|
63
|
-
# m = 12.method("+")
|
64
|
-
# m.call(3) #=> 15
|
65
|
-
# m.call(20) #=> 32
|
66
|
-
# ```
|
67
101
|
alias [] call
|
68
102
|
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
# methods
|
76
|
-
# arguments.
|
103
|
+
# <!--
|
104
|
+
# rdoc-file=proc.c
|
105
|
+
# - meth.arity -> integer
|
106
|
+
# -->
|
107
|
+
# Returns an indication of the number of arguments accepted by a method. Returns
|
108
|
+
# a nonnegative integer for methods that take a fixed number of arguments. For
|
109
|
+
# Ruby methods that take a variable number of arguments, returns -n-1, where n
|
110
|
+
# is the number of required arguments. Keyword arguments will be considered as a
|
111
|
+
# single additional argument, that argument being mandatory if any keyword
|
112
|
+
# argument is mandatory. For methods written in C, returns -1 if the call takes
|
113
|
+
# a variable number of arguments.
|
77
114
|
#
|
78
115
|
# class C
|
79
116
|
# def one; end
|
@@ -103,83 +140,170 @@ class Method < Object
|
|
103
140
|
# "cat".method(:replace).arity #=> 1
|
104
141
|
# "cat".method(:squeeze).arity #=> -1
|
105
142
|
# "cat".method(:count).arity #=> -1
|
143
|
+
#
|
106
144
|
def arity: () -> Integer
|
107
145
|
|
146
|
+
# <!--
|
147
|
+
# rdoc-file=proc.c
|
148
|
+
# - method.clone -> new_method
|
149
|
+
# -->
|
108
150
|
# Returns a clone of this method.
|
109
151
|
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
# m.call # => "bar"
|
119
|
-
#
|
120
|
-
# ```
|
152
|
+
# class A
|
153
|
+
# def foo
|
154
|
+
# return "bar"
|
155
|
+
# end
|
156
|
+
# end
|
157
|
+
#
|
158
|
+
# m = A.new.method(:foo)
|
159
|
+
# m.call # => "bar"
|
160
|
+
# n = m.clone.call # => "bar"
|
161
|
+
#
|
121
162
|
def clone: () -> Method
|
122
163
|
|
164
|
+
# <!--
|
165
|
+
# rdoc-file=proc.c
|
166
|
+
# - meth.curry -> proc
|
167
|
+
# - meth.curry(arity) -> proc
|
168
|
+
# -->
|
169
|
+
# Returns a curried proc based on the method. When the proc is called with a
|
170
|
+
# number of arguments that is lower than the method's arity, then another
|
171
|
+
# curried proc is returned. Only when enough arguments have been supplied to
|
172
|
+
# satisfy the method signature, will the method actually be called.
|
173
|
+
#
|
174
|
+
# The optional *arity* argument should be supplied when currying methods with
|
175
|
+
# variable arguments to determine how many arguments are needed before the
|
176
|
+
# method is called.
|
177
|
+
#
|
178
|
+
# def foo(a,b,c)
|
179
|
+
# [a, b, c]
|
180
|
+
# end
|
181
|
+
#
|
182
|
+
# proc = self.method(:foo).curry
|
183
|
+
# proc2 = proc.call(1, 2) #=> #<Proc>
|
184
|
+
# proc2.call(3) #=> [1,2,3]
|
185
|
+
#
|
186
|
+
# def vararg(*args)
|
187
|
+
# args
|
188
|
+
# end
|
189
|
+
#
|
190
|
+
# proc = self.method(:vararg).curry(4)
|
191
|
+
# proc2 = proc.call(:x) #=> #<Proc>
|
192
|
+
# proc3 = proc2.call(:y, :z) #=> #<Proc>
|
193
|
+
# proc3.call(:a) #=> [:x, :y, :z, :a]
|
194
|
+
#
|
123
195
|
def curry: (?Integer arity) -> Proc
|
124
196
|
|
197
|
+
# <!--
|
198
|
+
# rdoc-file=proc.c
|
199
|
+
# - meth.name -> symbol
|
200
|
+
# -->
|
125
201
|
# Returns the name of the method.
|
202
|
+
#
|
126
203
|
def name: () -> Symbol
|
127
204
|
|
205
|
+
# <!--
|
206
|
+
# rdoc-file=proc.c
|
207
|
+
# - meth.original_name -> symbol
|
208
|
+
# -->
|
128
209
|
# Returns the original name of the method.
|
129
210
|
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
# ```
|
211
|
+
# class C
|
212
|
+
# def foo; end
|
213
|
+
# alias bar foo
|
214
|
+
# end
|
215
|
+
# C.instance_method(:bar).original_name # => :foo
|
216
|
+
#
|
137
217
|
def original_name: () -> Symbol
|
138
218
|
|
139
|
-
#
|
219
|
+
# <!--
|
220
|
+
# rdoc-file=proc.c
|
221
|
+
# - meth.owner -> class_or_module
|
222
|
+
# -->
|
223
|
+
# Returns the class or module that defines the method. See also Method#receiver.
|
224
|
+
#
|
225
|
+
# (1..3).method(:map).owner #=> Enumerable
|
140
226
|
#
|
141
|
-
# ```ruby
|
142
|
-
# (1..3).method(:map).owner #=> Enumerable
|
143
|
-
# ```
|
144
227
|
def owner: () -> (Class | Module)
|
145
228
|
|
229
|
+
# <!--
|
230
|
+
# rdoc-file=proc.c
|
231
|
+
# - meth.parameters -> array
|
232
|
+
# -->
|
146
233
|
# Returns the parameter information of this method.
|
147
234
|
#
|
148
|
-
#
|
149
|
-
#
|
150
|
-
#
|
235
|
+
# def foo(bar); end
|
236
|
+
# method(:foo).parameters #=> [[:req, :bar]]
|
237
|
+
#
|
238
|
+
# def foo(bar, baz, bat, &blk); end
|
239
|
+
# method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:req, :bat], [:block, :blk]]
|
151
240
|
#
|
152
|
-
#
|
153
|
-
#
|
241
|
+
# def foo(bar, *args); end
|
242
|
+
# method(:foo).parameters #=> [[:req, :bar], [:rest, :args]]
|
154
243
|
#
|
155
|
-
#
|
156
|
-
#
|
244
|
+
# def foo(bar, baz, *args, &blk); end
|
245
|
+
# method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:rest, :args], [:block, :blk]]
|
246
|
+
#
|
247
|
+
def parameters: () -> ::Array[[ :req | :opt | :rest | :keyreq | :key | :keyrest | :block, Symbol ] | [ :rest | :keyrest ]]
|
248
|
+
|
249
|
+
# <!--
|
250
|
+
# rdoc-file=proc.c
|
251
|
+
# - meth.private? -> true or false
|
252
|
+
# -->
|
253
|
+
# Returns whether the method is private.
|
157
254
|
#
|
158
|
-
|
159
|
-
# method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:rest, :args], [:block, :blk]]
|
160
|
-
# ```
|
161
|
-
def parameters: () -> ::Array[
|
162
|
-
[:req | :opt | :rest | :keyreq | :key | :keyrest | :block, Symbol] |
|
163
|
-
[:rest | :keyrest]
|
164
|
-
]
|
255
|
+
def private?: () -> bool
|
165
256
|
|
257
|
+
# <!--
|
258
|
+
# rdoc-file=proc.c
|
259
|
+
# - meth.protected? -> true or false
|
260
|
+
# -->
|
261
|
+
# Returns whether the method is protected.
|
262
|
+
#
|
263
|
+
def protected?: () -> bool
|
264
|
+
|
265
|
+
# <!--
|
266
|
+
# rdoc-file=proc.c
|
267
|
+
# - meth.public? -> true or false
|
268
|
+
# -->
|
269
|
+
# Returns whether the method is public.
|
270
|
+
#
|
271
|
+
def public?: () -> bool
|
272
|
+
|
273
|
+
# <!--
|
274
|
+
# rdoc-file=proc.c
|
275
|
+
# - meth.receiver -> object
|
276
|
+
# -->
|
166
277
|
# Returns the bound receiver of the method object.
|
167
278
|
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
# ```
|
279
|
+
# (1..3).method(:map).receiver # => 1..3
|
280
|
+
#
|
171
281
|
def receiver: () -> untyped
|
172
282
|
|
173
|
-
#
|
174
|
-
#
|
175
|
-
|
283
|
+
# <!--
|
284
|
+
# rdoc-file=proc.c
|
285
|
+
# - meth.source_location -> [String, Integer]
|
286
|
+
# -->
|
287
|
+
# Returns the Ruby source filename and line number containing this method or nil
|
288
|
+
# if this method was not defined in Ruby (i.e. native).
|
289
|
+
#
|
290
|
+
def source_location: () -> [ String, Integer ]?
|
176
291
|
|
177
|
-
#
|
178
|
-
#
|
292
|
+
# <!--
|
293
|
+
# rdoc-file=proc.c
|
294
|
+
# - meth.super_method -> method
|
295
|
+
# -->
|
296
|
+
# Returns a Method of superclass which would be called when super is used or nil
|
297
|
+
# if there is no method on superclass.
|
298
|
+
#
|
179
299
|
def super_method: () -> Method?
|
180
300
|
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
301
|
+
# <!--
|
302
|
+
# rdoc-file=proc.c
|
303
|
+
# - meth.unbind -> unbound_method
|
304
|
+
# -->
|
305
|
+
# Dissociates *meth* from its current receiver. The resulting UnboundMethod can
|
306
|
+
# subsequently be bound to a new object of the same class (see UnboundMethod).
|
307
|
+
#
|
184
308
|
def unbind: () -> UnboundMethod
|
185
309
|
end
|