parlour 5.0.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb1e682fc74b2ccd30ac9055caf652889e898e2632347bf6cf0898f218bd5562
4
- data.tar.gz: fcca5ca04676cbeed657add051e344fd9b5fa0a7efc757339847310300aa4d42
3
+ metadata.gz: 1fd931ae39df4abe6c2080d7730f5ae9761f934e31632f0bade970a08f40e291
4
+ data.tar.gz: b1c626e9baef6177c35e0512807f08dd7d80bca7ffb0730529fdc8c4bd8923c3
5
5
  SHA512:
6
- metadata.gz: cef41723b922734b49f8377dc3b5c60cf0071d2a9723326299872fea4789f8e6ea1cb280fcd21161d48bd5dbb074b416e60668138116e56caf1c8334cce8e535
7
- data.tar.gz: b9ea0db060c8789e1324460cde4a69b1c20b829920e660024f53834e48cef536b5423736e6fce4859c2e2fea5339e3f26bdd7513947bafcc82bd239db57cc68a
6
+ metadata.gz: dafd27bee77f5cf8c86c1057b19a4ef3d62abcfd21ea79c8f914629cb857216345ec70cfe5919a1897c98426e30d180b06d5610a1295e190a81d5405cf648b44
7
+ data.tar.gz: b825ea72df23f2bf0e3e5aa406f1e5f5e9890ec52ddba815e3bebcafda52edc6f85590827f7d097fdb1897b57ef4b9ad4b0adec387e02525977a8d22d391467a
@@ -0,0 +1,46 @@
1
+ name: Run tests
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ strategy:
8
+ matrix:
9
+ ruby: [2.4, 2.5, 2.6, 2.7, 3.0]
10
+ continue-on-error: false
11
+
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby }}
19
+ - name: Install dependencies
20
+ run: bundle install
21
+ - name: Run tests
22
+ run: bundle exec rake
23
+ - name: Check RBI is up-to-date
24
+ run: ./ci/check_rbi.sh
25
+
26
+ # Deploy documentation to GitHub Pages, if this is a push to master and the tests passed
27
+ deploy-docs:
28
+ if: ${{ github.ref == 'refs/heads/master' }}
29
+
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v2
33
+ - name: Set up Ruby
34
+ uses: ruby/setup-ruby@v1
35
+ with:
36
+ ruby-version: 2.7
37
+ - name: Install dependencies
38
+ run: bundle install
39
+ - name: Build documentation
40
+ run: bundle exec yard
41
+ - name: Deploy to GitHub Actions
42
+ uses: JamesIves/github-pages-deploy-action@3.7.1
43
+ with:
44
+ github_token: ${{ secrets.GITHUB_TOKEN }}
45
+ branch: gh-pages
46
+ folder: doc
data/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
5
 
6
+ ## [6.0.0] - 2021-02-28
7
+ ### Changed
8
+ - The RBI previously included with the Parlour gem has been removed,
9
+ as it was causing issues with Sorbet. **If you were relying on Parlour's
10
+ bundled RBI while type-checking your project, you will now need to use the
11
+ RBI from sorbet-typed or the Parlour repo.**
12
+ - `Namespace#path` will now work much more reliably for classes and
13
+ modules which replace methods from `Module` and `Class`, such as
14
+ `#name`.
15
+
6
16
  ## [5.0.0] - 2020-12-26
7
17
  ### Added
8
18
  - Added RBS generation support! This includes:
@@ -106,28 +106,31 @@ module Parlour
106
106
  )
107
107
  end
108
108
 
109
- sig { params(object: T.untyped, block: T.proc.params(x: Namespace).void).void }
110
- # Given a Class or Module object, generates all classes and modules in the
111
- # path to that object, then executes the given block on the last
112
- # {Namespace}. This should only be executed on the root namespace.
113
- # @param [Class, Module] object
109
+ sig { params(constant: Module, block: T.proc.params(x: Namespace).void).void }
110
+ # Given a constant (i.e. a Module instance), generates all classes
111
+ # and modules in the path to that object, then executes the given
112
+ # block on the last {Namespace}. This should only be executed on
113
+ # the root namespace.
114
+ # @param [Module] constant
114
115
  # @param block A block which the new {Namespace} yields itself to.
115
- def path(object, &block)
116
+ def path(constant, &block)
116
117
  raise 'only call #path on root' if is_a?(ClassNamespace) || is_a?(ModuleNamespace)
117
118
 
118
- parts = object.to_s.split('::')
119
- parts_with_types = parts.size.times.map do |i|
120
- [parts[i], Module.const_get(parts[0..i].join('::')).class]
121
- end
119
+ constant_name = T.let(Module.instance_method(:name).bind(constant).call, T.nilable(String))
120
+ raise 'given constant does not have a name' unless constant_name
122
121
 
123
122
  current_part = self
124
- parts_with_types.each do |(name, type)|
125
- if type == Class
123
+ constant_name.split('::').each_with_object([]) do |name, namespace|
124
+ namespace << name
125
+ instance = Module.const_get(namespace.join("::"))
126
+
127
+ case instance
128
+ when Class
126
129
  current_part = current_part.create_class(name)
127
- elsif type == Module
130
+ when Module
128
131
  current_part = current_part.create_module(name)
129
132
  else
130
- raise "unexpected type: path part #{name} is a #{type}"
133
+ raise "unexpected type: path part #{name} is a #{instance.class}"
131
134
  end
132
135
  end
133
136
 
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
  module Parlour
3
3
  # The library version.
4
- VERSION = '5.0.0'
4
+ VERSION = '6.0.0'
5
5
  end
data/parlour.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  # Specify which files should be added to the gem when it is released.
17
17
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
18
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|sorbet)/}) }
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|sorbet|rbi)/}) }
20
20
  end
21
21
  spec.bindir = "exe"
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -32,4 +32,5 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency "rspec", "~> 3.0"
33
33
  spec.add_development_dependency "sorbet"
34
34
  spec.add_development_dependency "simplecov"
35
+ spec.add_development_dependency "yard"
35
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parlour
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Christiansen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-26 00:00:00.000000000 Z
11
+ date: 2021-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: yard
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description:
140
154
  email:
141
155
  - hello@aaronc.cc
@@ -146,10 +160,10 @@ extra_rdoc_files: []
146
160
  files:
147
161
  - ".github/ISSUE_TEMPLATE/bug-report.md"
148
162
  - ".github/ISSUE_TEMPLATE/feature-request.md"
163
+ - ".github/workflows/ruby.yml"
149
164
  - ".gitignore"
150
165
  - ".parlour"
151
166
  - ".rspec"
152
- - ".travis.yml"
153
167
  - CHANGELOG.md
154
168
  - CODE_OF_CONDUCT.md
155
169
  - Gemfile
@@ -209,7 +223,6 @@ files:
209
223
  - lib/parlour/version.rb
210
224
  - parlour.gemspec
211
225
  - plugin_examples/foobar_plugin.rb
212
- - rbi/parlour.rbi
213
226
  homepage: https://github.com/AaronC81/parlour
214
227
  licenses:
215
228
  - MIT
@@ -229,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
242
  - !ruby/object:Gem::Version
230
243
  version: '0'
231
244
  requirements: []
232
- rubygems_version: 3.0.3
245
+ rubygems_version: 3.2.0.rc.1
233
246
  signing_key:
234
247
  specification_version: 4
235
248
  summary: A type information generator, merger and parser for Sorbet and Ruby 3/Steep
data/.travis.yml DELETED
@@ -1,32 +0,0 @@
1
- language: ruby
2
- dist: trusty
3
- before_install:
4
- - gem install bundler
5
- - gem install yard
6
- - chmod +x ci/check_rbi.sh
7
- rvm:
8
- - 2.3
9
- - 2.4
10
- - 2.5
11
- - 2.6
12
- - 2.7
13
- - ruby-head
14
-
15
- jobs:
16
- include:
17
- - stage: check RBI
18
- script: ./ci/check_rbi.sh
19
- rvm: 2.7
20
- - stage: deploy documentation
21
- script: yard
22
- deploy:
23
- provider: pages
24
- local_dir: doc
25
- skip_cleanup: true
26
- github_token: $GITHUB_TOKEN
27
- keep_history: true
28
- on:
29
- branch: master
30
- allow_failures:
31
- - rvm: 2.3
32
- - rvm: ruby-head
data/rbi/parlour.rbi DELETED
@@ -1,1896 +0,0 @@
1
- # typed: strong
2
- module Kernel
3
- end
4
-
5
- module Parlour
6
- VERSION = '5.0.0'
7
-
8
- class ConflictResolver
9
- extend T::Sig
10
-
11
- sig { params(namespace: RbiGenerator::Namespace, resolver: T.proc.params(
12
- desc: String,
13
- choices: T::Array[RbiGenerator::RbiObject]
14
- ).returns(T.nilable(RbiGenerator::RbiObject))).void }
15
- def resolve_conflicts(namespace, &resolver); end
16
-
17
- sig { params(arr: T::Array[T.untyped]).returns(T.nilable(Symbol)) }
18
- def merge_strategy(arr); end
19
-
20
- sig { params(arr: T::Array[T.untyped]).returns(T::Boolean) }
21
- def all_eql?(arr); end
22
-
23
- sig { params(namespace: RbiGenerator::Namespace, name: T.nilable(String)).void }
24
- def deduplicate_mixins_of_name(namespace, name); end
25
- end
26
-
27
- module Debugging
28
- extend T::Sig
29
-
30
- sig { params(value: T::Boolean).returns(T::Boolean) }
31
- def self.debug_mode=(value); end
32
-
33
- sig { returns(T::Boolean) }
34
- def self.debug_mode?; end
35
-
36
- sig { params(object: T.untyped, message: String).void }
37
- def self.debug_puts(object, message); end
38
-
39
- sig { params(object: T.untyped).returns(String) }
40
- def self.name_for_debug_caller(object); end
41
-
42
- module Tree
43
- extend T::Sig
44
- INDENT_SPACES = 2
45
-
46
- sig { params(message: String).returns(String) }
47
- def self.begin(message); end
48
-
49
- sig { params(message: String).returns(String) }
50
- def self.here(message); end
51
-
52
- sig { params(message: String).returns(String) }
53
- def self.end(message); end
54
-
55
- sig { returns(T.untyped) }
56
- def self.line_prefix; end
57
-
58
- sig { returns(T.untyped) }
59
- def self.text_prefix; end
60
- end
61
- end
62
-
63
- class DetachedRbsGenerator < RbsGenerator
64
- sig { returns(T.untyped) }
65
- def detached!; end
66
-
67
- sig { override.returns(Options) }
68
- def options; end
69
-
70
- sig { override.returns(T.nilable(Plugin)) }
71
- def current_plugin; end
72
-
73
- sig { override.returns(String) }
74
- def rbs; end
75
- end
76
-
77
- class Generator
78
- extend T::Sig
79
-
80
- sig { params(break_params: Integer, tab_size: Integer, sort_namespaces: T::Boolean).void }
81
- def initialize(break_params: 4, tab_size: 2, sort_namespaces: false); end
82
-
83
- sig { returns(Options) }
84
- attr_reader :options
85
-
86
- sig { returns(T.nilable(Plugin)) }
87
- attr_accessor :current_plugin
88
- end
89
-
90
- class Options
91
- extend T::Sig
92
-
93
- sig { params(break_params: Integer, tab_size: Integer, sort_namespaces: T::Boolean).void }
94
- def initialize(break_params:, tab_size:, sort_namespaces:); end
95
-
96
- sig { returns(Integer) }
97
- attr_reader :break_params
98
-
99
- sig { returns(Integer) }
100
- attr_reader :tab_size
101
-
102
- sig { returns(T::Boolean) }
103
- attr_reader :sort_namespaces
104
-
105
- sig { params(level: Integer, str: String).returns(String) }
106
- def indented(level, str); end
107
- end
108
-
109
- class ParseError < StandardError
110
- extend T::Sig
111
-
112
- sig { returns(Parser::Source::Buffer) }
113
- attr_reader :buffer
114
-
115
- sig { returns(Parser::Source::Range) }
116
- attr_reader :range
117
-
118
- sig { params(buffer: T.untyped, range: T.untyped).returns(T.untyped) }
119
- def initialize(buffer, range); end
120
- end
121
-
122
- class Plugin
123
- abstract!
124
-
125
- extend T::Sig
126
- extend T::Helpers
127
-
128
- sig { returns(T::Hash[String, T.class_of(Plugin)]) }
129
- def self.registered_plugins; end
130
-
131
- sig { params(new_plugin: T.class_of(Plugin)).void }
132
- def self.inherited(new_plugin); end
133
-
134
- sig { params(plugins: T::Array[Plugin], generator: RbiGenerator, allow_failure: T::Boolean).void }
135
- def self.run_plugins(plugins, generator, allow_failure: true); end
136
-
137
- sig { params(options: T::Hash[T.untyped, T.untyped]).void }
138
- def initialize(options); end
139
-
140
- sig { abstract.params(root: RbiGenerator::Namespace).void }
141
- def generate(root); end
142
-
143
- sig { returns(T.nilable(String)) }
144
- attr_accessor :strictness
145
- end
146
-
147
- module TypeLoader
148
- extend T::Sig
149
-
150
- sig { params(source: String, filename: T.nilable(String), generator: T.nilable(RbiGenerator)).returns(RbiGenerator::Namespace) }
151
- def self.load_source(source, filename = nil, generator: nil); end
152
-
153
- sig { params(filename: String, generator: T.nilable(RbiGenerator)).returns(RbiGenerator::Namespace) }
154
- def self.load_file(filename, generator: nil); end
155
-
156
- sig do
157
- params(
158
- root: String,
159
- inclusions: T::Array[String],
160
- exclusions: T::Array[String],
161
- generator: T.nilable(RbiGenerator)
162
- ).returns(RbiGenerator::Namespace)
163
- end
164
- def self.load_project(root, inclusions: ['.'], exclusions: [], generator: nil); end
165
- end
166
-
167
- class TypeParser
168
- extend T::Sig
169
-
170
- class NodePath
171
- extend T::Sig
172
-
173
- sig { returns(T::Array[Integer]) }
174
- attr_reader :indices
175
-
176
- sig { params(indices: T::Array[Integer]).void }
177
- def initialize(indices); end
178
-
179
- sig { returns(NodePath) }
180
- def parent; end
181
-
182
- sig { params(index: Integer).returns(NodePath) }
183
- def child(index); end
184
-
185
- sig { params(offset: Integer).returns(NodePath) }
186
- def sibling(offset); end
187
-
188
- sig { params(start: Parser::AST::Node).returns(Parser::AST::Node) }
189
- def traverse(start); end
190
- end
191
-
192
- sig { params(ast: Parser::AST::Node, unknown_node_errors: T::Boolean, generator: T.nilable(RbiGenerator)).void }
193
- def initialize(ast, unknown_node_errors: false, generator: nil); end
194
-
195
- sig { params(filename: String, source: String, generator: T.nilable(RbiGenerator)).returns(TypeParser) }
196
- def self.from_source(filename, source, generator: nil); end
197
-
198
- sig { returns(Parser::AST::Node) }
199
- attr_accessor :ast
200
-
201
- sig { returns(T::Boolean) }
202
- attr_reader :unknown_node_errors
203
-
204
- sig { returns(RbiGenerator) }
205
- attr_accessor :generator
206
-
207
- sig { returns(RbiGenerator::Namespace) }
208
- def parse_all; end
209
-
210
- sig { params(path: NodePath, is_within_eigenclass: T::Boolean).returns(T::Array[RbiGenerator::RbiObject]) }
211
- def parse_path_to_object(path, is_within_eigenclass: false); end
212
-
213
- class IntermediateSig < T::Struct
214
- prop :type_parameters, T.nilable(T::Array[Symbol])
215
- prop :overridable, T::Boolean
216
- prop :override, T::Boolean
217
- prop :abstract, T::Boolean
218
- prop :final, T::Boolean
219
- prop :return_type, T.nilable(String)
220
- prop :params, T.nilable(T::Array[Parser::AST::Node])
221
-
222
- end
223
-
224
- sig { params(path: NodePath).returns(IntermediateSig) }
225
- def parse_sig_into_sig(path); end
226
-
227
- sig { params(path: NodePath, is_within_eigenclass: T::Boolean).returns(T::Array[RbiGenerator::Method]) }
228
- def parse_sig_into_methods(path, is_within_eigenclass: false); end
229
-
230
- sig { params(path: NodePath, is_within_eigenclass: T::Boolean).returns(T::Array[RbiGenerator::Method]) }
231
- def parse_method_into_methods(path, is_within_eigenclass: false); end
232
-
233
- sig { params(str: String).returns(Types::Type) }
234
- def self.parse_single_type(str); end
235
-
236
- sig { params(node: Parser::AST::Node).returns(Types::Type) }
237
- def parse_node_to_type(node); end
238
-
239
- sig { params(msg: String, node: Parser::AST::Node).void }
240
- def warning(msg, node); end
241
-
242
- sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Array[Symbol]) }
243
- def constant_names(node); end
244
-
245
- sig { params(node: Parser::AST::Node).returns(T::Boolean) }
246
- def sig_node?(node); end
247
-
248
- sig { params(path: NodePath).returns(T::Boolean) }
249
- def previous_sibling_sig_node?(path); end
250
-
251
- sig { params(node: T.nilable(Parser::AST::Node)).returns(T.nilable(String)) }
252
- def node_to_s(node); end
253
-
254
- sig { params(node: T.nilable(Parser::AST::Node), modifier: Symbol).returns(T::Boolean) }
255
- def body_has_modifier?(node, modifier); end
256
-
257
- sig { params(node: Parser::AST::Node).returns([T::Array[String], T::Array[String]]) }
258
- def body_includes_and_extends(node); end
259
-
260
- sig { params(desc: String, node: T.any(Parser::AST::Node, NodePath)).returns(T.noreturn) }
261
- def parse_err(desc, node); end
262
-
263
- sig do
264
- type_parameters(:A, :B).params(
265
- a: T::Array[T.type_parameter(:A)],
266
- fa: T.proc.params(item: T.type_parameter(:A)).returns(T.untyped),
267
- b: T::Array[T.type_parameter(:B)],
268
- fb: T.proc.params(item: T.type_parameter(:B)).returns(T.untyped)
269
- ).returns(T::Array[[T.type_parameter(:A), T.type_parameter(:B)]])
270
- end
271
- def zip_by(a, fa, b, fb); end
272
- end
273
-
274
- class TypedObject
275
- abstract!
276
-
277
- extend T::Sig
278
- extend T::Helpers
279
-
280
- sig { params(name: String).void }
281
- def initialize(name); end
282
-
283
- sig { returns(T.nilable(Plugin)) }
284
- attr_reader :generated_by
285
-
286
- sig { returns(String) }
287
- attr_reader :name
288
-
289
- sig { returns(T::Array[String]) }
290
- attr_reader :comments
291
-
292
- sig { params(comment: T.any(String, T::Array[String])).void }
293
- def add_comment(comment); end
294
-
295
- sig { abstract.returns(String) }
296
- def describe; end
297
-
298
- sig { params(indent_level: Integer, options: Options).returns(T::Array[String]) }
299
- def generate_comments(indent_level, options); end
300
- end
301
-
302
- module Types
303
- TypeLike = T.type_alias { T.any(String, Type) }
304
-
305
- class Type
306
- abstract!
307
-
308
- extend T::Sig
309
- extend T::Helpers
310
-
311
- sig { abstract.returns(String) }
312
- def generate_rbi; end
313
-
314
- sig { abstract.returns(String) }
315
- def generate_rbs; end
316
-
317
- sig { params(type_like: TypeLike).returns(Type) }
318
- def self.to_type(type_like); end
319
-
320
- sig { params(type_like: TypeLike).returns(Type) }
321
- def to_type(type_like); end
322
-
323
- sig { returns(T.untyped) }
324
- def hash; end
325
-
326
- sig { abstract.returns(String) }
327
- def describe; end
328
- end
329
-
330
- class Raw < Type
331
- sig { params(str: String).void }
332
- def initialize(str); end
333
-
334
- sig { returns(String) }
335
- attr_reader :str
336
-
337
- sig { params(other: Object).returns(T::Boolean) }
338
- def ==(other); end
339
-
340
- sig { override.returns(String) }
341
- def generate_rbi; end
342
-
343
- sig { override.returns(String) }
344
- def generate_rbs; end
345
-
346
- sig { override.returns(String) }
347
- def describe; end
348
- end
349
-
350
- class Nilable < Type
351
- sig { params(type: TypeLike).void }
352
- def initialize(type); end
353
-
354
- sig { params(other: Object).returns(T::Boolean) }
355
- def ==(other); end
356
-
357
- sig { returns(Type) }
358
- attr_reader :type
359
-
360
- sig { override.returns(String) }
361
- def generate_rbi; end
362
-
363
- sig { override.returns(String) }
364
- def generate_rbs; end
365
-
366
- sig { override.returns(String) }
367
- def describe; end
368
- end
369
-
370
- class Union < Type
371
- sig { params(types: T::Array[TypeLike]).void }
372
- def initialize(types); end
373
-
374
- sig { params(other: Object).returns(T::Boolean) }
375
- def ==(other); end
376
-
377
- sig { returns(T::Array[Type]) }
378
- attr_reader :types
379
-
380
- sig { override.returns(String) }
381
- def generate_rbi; end
382
-
383
- sig { override.returns(String) }
384
- def generate_rbs; end
385
-
386
- sig { override.returns(String) }
387
- def describe; end
388
- end
389
-
390
- class Intersection < Type
391
- sig { params(types: T::Array[TypeLike]).void }
392
- def initialize(types); end
393
-
394
- sig { params(other: Object).returns(T::Boolean) }
395
- def ==(other); end
396
-
397
- sig { returns(T::Array[Type]) }
398
- attr_reader :types
399
-
400
- sig { override.returns(String) }
401
- def generate_rbi; end
402
-
403
- sig { override.returns(String) }
404
- def generate_rbs; end
405
-
406
- sig { override.returns(String) }
407
- def describe; end
408
- end
409
-
410
- class Tuple < Type
411
- sig { params(types: T::Array[TypeLike]).void }
412
- def initialize(types); end
413
-
414
- sig { params(other: Object).returns(T::Boolean) }
415
- def ==(other); end
416
-
417
- sig { returns(T::Array[Type]) }
418
- attr_reader :types
419
-
420
- sig { override.returns(String) }
421
- def generate_rbi; end
422
-
423
- sig { override.returns(String) }
424
- def generate_rbs; end
425
-
426
- sig { override.returns(String) }
427
- def describe; end
428
- end
429
-
430
- class Generic < Type
431
- sig { params(type: TypeLike, type_params: T::Array[TypeLike]).void }
432
- def initialize(type, type_params); end
433
-
434
- sig { params(other: Object).returns(T::Boolean) }
435
- def ==(other); end
436
-
437
- sig { returns(Type) }
438
- attr_reader :type
439
-
440
- sig { returns(T::Array[Type]) }
441
- attr_reader :type_params
442
-
443
- sig { override.returns(String) }
444
- def generate_rbi; end
445
-
446
- sig { override.returns(String) }
447
- def generate_rbs; end
448
-
449
- sig { override.returns(String) }
450
- def describe; end
451
- end
452
-
453
- class SingleElementCollection < Type
454
- abstract!
455
-
456
- sig { params(element: TypeLike).void }
457
- def initialize(element); end
458
-
459
- sig { returns(Type) }
460
- attr_reader :element
461
-
462
- sig { abstract.returns(String) }
463
- def collection_name; end
464
-
465
- sig { override.returns(String) }
466
- def generate_rbi; end
467
-
468
- sig { override.returns(String) }
469
- def generate_rbs; end
470
-
471
- sig { override.returns(String) }
472
- def describe; end
473
- end
474
-
475
- class Array < SingleElementCollection
476
- sig { override.returns(String) }
477
- def collection_name; end
478
-
479
- sig { params(other: Object).returns(T::Boolean) }
480
- def ==(other); end
481
- end
482
-
483
- class Set < SingleElementCollection
484
- sig { override.returns(String) }
485
- def collection_name; end
486
-
487
- sig { params(other: Object).returns(T::Boolean) }
488
- def ==(other); end
489
- end
490
-
491
- class Range < SingleElementCollection
492
- sig { override.returns(String) }
493
- def collection_name; end
494
-
495
- sig { params(other: Object).returns(T::Boolean) }
496
- def ==(other); end
497
- end
498
-
499
- class Enumerable < SingleElementCollection
500
- sig { override.returns(String) }
501
- def collection_name; end
502
-
503
- sig { params(other: Object).returns(T::Boolean) }
504
- def ==(other); end
505
- end
506
-
507
- class Enumerator < SingleElementCollection
508
- sig { override.returns(String) }
509
- def collection_name; end
510
-
511
- sig { params(other: Object).returns(T::Boolean) }
512
- def ==(other); end
513
- end
514
-
515
- class Hash < Type
516
- sig { params(key: TypeLike, value: TypeLike).void }
517
- def initialize(key, value); end
518
-
519
- sig { params(other: Object).returns(T::Boolean) }
520
- def ==(other); end
521
-
522
- sig { returns(Type) }
523
- attr_reader :key
524
-
525
- sig { returns(Type) }
526
- attr_reader :value
527
-
528
- sig { override.returns(String) }
529
- def generate_rbi; end
530
-
531
- sig { override.returns(String) }
532
- def generate_rbs; end
533
-
534
- sig { override.returns(String) }
535
- def describe; end
536
- end
537
-
538
- class Record < Type
539
- sig { params(keys_to_types: T::Hash[Symbol, TypeLike]).void }
540
- def initialize(keys_to_types); end
541
-
542
- sig { params(other: Object).returns(T::Boolean) }
543
- def ==(other); end
544
-
545
- sig { returns(T::Hash[Symbol, Type]) }
546
- attr_reader :keys_to_types
547
-
548
- sig { override.returns(String) }
549
- def generate_rbi; end
550
-
551
- sig { override.returns(String) }
552
- def generate_rbs; end
553
-
554
- sig { override.returns(String) }
555
- def describe; end
556
- end
557
-
558
- class Class < Type
559
- sig { params(type: TypeLike).void }
560
- def initialize(type); end
561
-
562
- sig { params(other: Object).returns(T::Boolean) }
563
- def ==(other); end
564
-
565
- sig { returns(Type) }
566
- attr_reader :type
567
-
568
- sig { override.returns(String) }
569
- def generate_rbi; end
570
-
571
- sig { override.returns(String) }
572
- def generate_rbs; end
573
-
574
- sig { override.returns(String) }
575
- def describe; end
576
- end
577
-
578
- class Boolean < Type
579
- sig { params(other: Object).returns(T::Boolean) }
580
- def ==(other); end
581
-
582
- sig { override.returns(String) }
583
- def generate_rbi; end
584
-
585
- sig { override.returns(String) }
586
- def generate_rbs; end
587
-
588
- sig { override.returns(String) }
589
- def describe; end
590
- end
591
-
592
- class Self < Type
593
- sig { params(other: Object).returns(T::Boolean) }
594
- def ==(other); end
595
-
596
- sig { override.returns(String) }
597
- def generate_rbi; end
598
-
599
- sig { override.returns(String) }
600
- def generate_rbs; end
601
-
602
- sig { override.returns(String) }
603
- def describe; end
604
- end
605
-
606
- class Untyped < Type
607
- sig { params(other: Object).returns(T::Boolean) }
608
- def ==(other); end
609
-
610
- sig { override.returns(String) }
611
- def generate_rbi; end
612
-
613
- sig { override.returns(String) }
614
- def generate_rbs; end
615
-
616
- sig { override.returns(String) }
617
- def describe; end
618
- end
619
-
620
- class Proc < Type
621
- class Parameter
622
- extend T::Sig
623
-
624
- sig { params(name: String, type: TypeLike, default: T.nilable(String)).void }
625
- def initialize(name, type, default = nil); end
626
-
627
- sig { returns(String) }
628
- attr_reader :name
629
-
630
- sig { returns(Type) }
631
- attr_reader :type
632
-
633
- sig { returns(T.nilable(String)) }
634
- attr_reader :default
635
-
636
- sig { params(other: Object).returns(T::Boolean) }
637
- def ==(other); end
638
- end
639
-
640
- sig { params(parameters: T::Array[Parameter], return_type: T.nilable(TypeLike)).void }
641
- def initialize(parameters, return_type); end
642
-
643
- sig { params(other: Object).returns(T::Boolean) }
644
- def ==(other); end
645
-
646
- sig { returns(T::Array[Parameter]) }
647
- attr_reader :parameters
648
-
649
- sig { returns(T.nilable(Type)) }
650
- attr_reader :return_type
651
-
652
- sig { override.returns(String) }
653
- def generate_rbi; end
654
-
655
- sig { override.returns(String) }
656
- def generate_rbs; end
657
-
658
- sig { override.returns(String) }
659
- def describe; end
660
- end
661
- end
662
-
663
- module Conversion
664
- class Converter
665
- abstract!
666
-
667
- extend T::Sig
668
- extend T::Helpers
669
-
670
- sig { returns(T.untyped) }
671
- def initialize; end
672
-
673
- sig { returns(T::Array[[String, TypedObject]]) }
674
- attr_reader :warnings
675
-
676
- sig { params(msg: String, node: RbiGenerator::RbiObject).void }
677
- def add_warning(msg, node); end
678
- end
679
-
680
- class RbiToRbs < Converter
681
- extend T::Sig
682
-
683
- sig { params(rbs_gen: RbsGenerator).void }
684
- def initialize(rbs_gen); end
685
-
686
- sig { returns(RbsGenerator) }
687
- attr_reader :rbs_gen
688
-
689
- sig { params(from: RbiGenerator::Namespace, to: RbsGenerator::Namespace).void }
690
- def convert_all(from, to); end
691
-
692
- sig { params(node: RbiGenerator::RbiObject, new_parent: RbsGenerator::Namespace).void }
693
- def convert_object(node, new_parent); end
694
- end
695
- end
696
-
697
- class RbiGenerator < Generator
698
- Options = Parlour::Options
699
-
700
- sig { params(hash: T.untyped).returns(T.untyped) }
701
- def initialize(**hash); end
702
-
703
- sig { returns(RbiGenerator::Namespace) }
704
- attr_reader :root
705
-
706
- sig { overridable.params(strictness: String).returns(String) }
707
- def rbi(strictness = 'strong'); end
708
-
709
- class Arbitrary < RbiObject
710
- sig { params(generator: Generator, code: String, block: T.nilable(T.proc.params(x: Arbitrary).void)).void }
711
- def initialize(generator, code: '', &block); end
712
-
713
- sig { returns(String) }
714
- attr_accessor :code
715
-
716
- sig { params(other: Object).returns(T::Boolean) }
717
- def ==(other); end
718
-
719
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
720
- def generate_rbi(indent_level, options); end
721
-
722
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
723
- def mergeable?(others); end
724
-
725
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
726
- def merge_into_self(others); end
727
-
728
- sig { override.returns(String) }
729
- def describe; end
730
-
731
- sig { override.void }
732
- def generalize_from_rbi!; end
733
- end
734
-
735
- class Attribute < Method
736
- sig do
737
- params(
738
- generator: Generator,
739
- name: String,
740
- kind: Symbol,
741
- type: Types::TypeLike,
742
- class_attribute: T::Boolean,
743
- block: T.nilable(T.proc.params(x: Attribute).void)
744
- ).void
745
- end
746
- def initialize(generator, name, kind, type, class_attribute: false, &block); end
747
-
748
- sig { returns(Symbol) }
749
- attr_reader :kind
750
-
751
- sig { returns(T::Boolean) }
752
- attr_reader :class_attribute
753
-
754
- sig { returns(Types::TypeLike) }
755
- attr_reader :type
756
-
757
- sig { override.params(other: Object).returns(T::Boolean) }
758
- def ==(other); end
759
-
760
- sig { override.void }
761
- def generalize_from_rbi!; end
762
-
763
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
764
- def generate_definition(indent_level, options); end
765
- end
766
-
767
- class ClassNamespace < Namespace
768
- extend T::Sig
769
-
770
- sig do
771
- params(
772
- generator: Generator,
773
- name: String,
774
- final: T::Boolean,
775
- sealed: T::Boolean,
776
- superclass: T.nilable(String),
777
- abstract: T::Boolean,
778
- block: T.nilable(T.proc.params(x: ClassNamespace).void)
779
- ).void
780
- end
781
- def initialize(generator, name, final, sealed, superclass, abstract, &block); end
782
-
783
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
784
- def generate_rbi(indent_level, options); end
785
-
786
- sig { returns(T.nilable(String)) }
787
- attr_reader :superclass
788
-
789
- sig { returns(T::Boolean) }
790
- attr_reader :abstract
791
-
792
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
793
- def mergeable?(others); end
794
-
795
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
796
- def merge_into_self(others); end
797
-
798
- sig { override.returns(String) }
799
- def describe; end
800
-
801
- sig { override.void }
802
- def generalize_from_rbi!; end
803
- end
804
-
805
- class Constant < RbiObject
806
- sig do
807
- params(
808
- generator: Generator,
809
- name: String,
810
- value: Types::TypeLike,
811
- eigen_constant: T::Boolean,
812
- block: T.nilable(T.proc.params(x: Constant).void)
813
- ).void
814
- end
815
- def initialize(generator, name: '', value: '', eigen_constant: false, &block); end
816
-
817
- sig { returns(Types::TypeLike) }
818
- attr_reader :value
819
-
820
- sig { returns(T.untyped) }
821
- attr_reader :eigen_constant
822
-
823
- sig { params(other: Object).returns(T::Boolean) }
824
- def ==(other); end
825
-
826
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
827
- def generate_rbi(indent_level, options); end
828
-
829
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
830
- def mergeable?(others); end
831
-
832
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
833
- def merge_into_self(others); end
834
-
835
- sig { override.returns(String) }
836
- def describe; end
837
-
838
- sig { override.void }
839
- def generalize_from_rbi!; end
840
- end
841
-
842
- class EnumClassNamespace < ClassNamespace
843
- extend T::Sig
844
-
845
- sig do
846
- params(
847
- generator: Generator,
848
- name: String,
849
- final: T::Boolean,
850
- sealed: T::Boolean,
851
- enums: T::Array[T.any([String, String], String)],
852
- abstract: T::Boolean,
853
- block: T.nilable(T.proc.params(x: EnumClassNamespace).void)
854
- ).void
855
- end
856
- def initialize(generator, name, final, sealed, enums, abstract, &block); end
857
-
858
- sig { returns(T::Array[T.any([String, String], String)]) }
859
- attr_reader :enums
860
-
861
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
862
- def generate_body(indent_level, options); end
863
-
864
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
865
- def mergeable?(others); end
866
-
867
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
868
- def merge_into_self(others); end
869
-
870
- sig { override.void }
871
- def generalize_from_rbi!; end
872
- end
873
-
874
- class Extend < RbiObject
875
- sig { params(generator: Generator, name: String, block: T.nilable(T.proc.params(x: Extend).void)).void }
876
- def initialize(generator, name: '', &block); end
877
-
878
- sig { params(other: Object).returns(T::Boolean) }
879
- def ==(other); end
880
-
881
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
882
- def generate_rbi(indent_level, options); end
883
-
884
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
885
- def mergeable?(others); end
886
-
887
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
888
- def merge_into_self(others); end
889
-
890
- sig { override.returns(String) }
891
- def describe; end
892
-
893
- sig { override.void }
894
- def generalize_from_rbi!; end
895
- end
896
-
897
- class Include < RbiObject
898
- sig { params(generator: Generator, name: String, block: T.nilable(T.proc.params(x: Include).void)).void }
899
- def initialize(generator, name: '', &block); end
900
-
901
- sig { params(other: Object).returns(T::Boolean) }
902
- def ==(other); end
903
-
904
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
905
- def generate_rbi(indent_level, options); end
906
-
907
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
908
- def mergeable?(others); end
909
-
910
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
911
- def merge_into_self(others); end
912
-
913
- sig { override.returns(String) }
914
- def describe; end
915
-
916
- sig { override.void }
917
- def generalize_from_rbi!; end
918
- end
919
-
920
- class Method < RbiObject
921
- extend T::Sig
922
-
923
- sig do
924
- params(
925
- generator: Generator,
926
- name: String,
927
- parameters: T::Array[Parameter],
928
- return_type: T.nilable(Types::TypeLike),
929
- abstract: T::Boolean,
930
- implementation: T::Boolean,
931
- override: T::Boolean,
932
- overridable: T::Boolean,
933
- class_method: T::Boolean,
934
- final: T::Boolean,
935
- type_parameters: T.nilable(T::Array[Symbol]),
936
- block: T.nilable(T.proc.params(x: Method).void)
937
- ).void
938
- end
939
- def initialize(generator, name, parameters, return_type = nil, abstract: false, implementation: false, override: false, overridable: false, class_method: false, final: false, type_parameters: nil, &block); end
940
-
941
- sig { overridable.params(other: Object).returns(T::Boolean) }
942
- def ==(other); end
943
-
944
- sig { returns(T::Array[Parameter]) }
945
- attr_reader :parameters
946
-
947
- sig { returns(T.nilable(Types::TypeLike)) }
948
- attr_reader :return_type
949
-
950
- sig { returns(T::Boolean) }
951
- attr_reader :abstract
952
-
953
- sig { returns(T::Boolean) }
954
- attr_reader :implementation
955
-
956
- sig { returns(T::Boolean) }
957
- attr_reader :override
958
-
959
- sig { returns(T::Boolean) }
960
- attr_reader :overridable
961
-
962
- sig { returns(T::Boolean) }
963
- attr_reader :class_method
964
-
965
- sig { returns(T::Boolean) }
966
- attr_reader :final
967
-
968
- sig { returns(T::Array[Symbol]) }
969
- attr_reader :type_parameters
970
-
971
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
972
- def generate_rbi(indent_level, options); end
973
-
974
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
975
- def mergeable?(others); end
976
-
977
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
978
- def merge_into_self(others); end
979
-
980
- sig { override.returns(String) }
981
- def describe; end
982
-
983
- sig { override.void }
984
- def generalize_from_rbi!; end
985
-
986
- sig { overridable.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
987
- def generate_definition(indent_level, options); end
988
-
989
- sig { returns(String) }
990
- def qualifiers; end
991
- end
992
-
993
- class ModuleNamespace < Namespace
994
- extend T::Sig
995
-
996
- sig do
997
- params(
998
- generator: Generator,
999
- name: String,
1000
- final: T::Boolean,
1001
- sealed: T::Boolean,
1002
- interface: T::Boolean,
1003
- abstract: T::Boolean,
1004
- block: T.nilable(T.proc.params(x: ClassNamespace).void)
1005
- ).void
1006
- end
1007
- def initialize(generator, name, final, sealed, interface, abstract, &block); end
1008
-
1009
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1010
- def generate_rbi(indent_level, options); end
1011
-
1012
- sig { returns(T::Boolean) }
1013
- attr_reader :interface
1014
-
1015
- sig { returns(T::Boolean) }
1016
- attr_reader :abstract
1017
-
1018
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
1019
- def mergeable?(others); end
1020
-
1021
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
1022
- def merge_into_self(others); end
1023
-
1024
- sig { override.returns(String) }
1025
- def describe; end
1026
-
1027
- sig { override.void }
1028
- def generalize_from_rbi!; end
1029
- end
1030
-
1031
- class Namespace < RbiObject
1032
- extend T::Sig
1033
-
1034
- sig { override.overridable.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1035
- def generate_rbi(indent_level, options); end
1036
-
1037
- sig do
1038
- params(
1039
- generator: Generator,
1040
- name: T.nilable(String),
1041
- final: T::Boolean,
1042
- sealed: T::Boolean,
1043
- block: T.nilable(T.proc.params(x: Namespace).void)
1044
- ).void
1045
- end
1046
- def initialize(generator, name = nil, final = false, sealed = false, &block); end
1047
-
1048
- sig { returns(T::Boolean) }
1049
- attr_reader :final
1050
-
1051
- sig { returns(T::Boolean) }
1052
- attr_reader :sealed
1053
-
1054
- sig { returns(T::Array[RbiObject]) }
1055
- attr_reader :children
1056
-
1057
- sig { returns(T::Array[RbiGenerator::Extend]) }
1058
- def extends; end
1059
-
1060
- sig { returns(T::Array[RbiGenerator::Include]) }
1061
- def includes; end
1062
-
1063
- sig { returns(T::Array[RbiGenerator::TypeAlias]) }
1064
- def aliases; end
1065
-
1066
- sig { returns(T::Array[RbiGenerator::Constant]) }
1067
- def constants; end
1068
-
1069
- sig { params(object: T.untyped, block: T.proc.params(x: Namespace).void).void }
1070
- def path(object, &block); end
1071
-
1072
- sig { params(comment: T.any(String, T::Array[String])).void }
1073
- def add_comment_to_next_child(comment); end
1074
-
1075
- sig do
1076
- params(
1077
- name: String,
1078
- final: T::Boolean,
1079
- sealed: T::Boolean,
1080
- superclass: T.nilable(String),
1081
- abstract: T::Boolean,
1082
- block: T.nilable(T.proc.params(x: ClassNamespace).void)
1083
- ).returns(ClassNamespace)
1084
- end
1085
- def create_class(name, final: false, sealed: false, superclass: nil, abstract: false, &block); end
1086
-
1087
- sig do
1088
- params(
1089
- name: String,
1090
- final: T::Boolean,
1091
- sealed: T::Boolean,
1092
- enums: T.nilable(T::Array[T.any([String, String], String)]),
1093
- abstract: T::Boolean,
1094
- block: T.nilable(T.proc.params(x: EnumClassNamespace).void)
1095
- ).returns(EnumClassNamespace)
1096
- end
1097
- def create_enum_class(name, final: false, sealed: false, enums: nil, abstract: false, &block); end
1098
-
1099
- sig do
1100
- params(
1101
- name: String,
1102
- final: T::Boolean,
1103
- sealed: T::Boolean,
1104
- props: T.nilable(T::Array[StructProp]),
1105
- abstract: T::Boolean,
1106
- block: T.nilable(T.proc.params(x: StructClassNamespace).void)
1107
- ).returns(StructClassNamespace)
1108
- end
1109
- def create_struct_class(name, final: false, sealed: false, props: nil, abstract: false, &block); end
1110
-
1111
- sig do
1112
- params(
1113
- name: String,
1114
- final: T::Boolean,
1115
- sealed: T::Boolean,
1116
- interface: T::Boolean,
1117
- abstract: T::Boolean,
1118
- block: T.nilable(T.proc.params(x: ClassNamespace).void)
1119
- ).returns(ModuleNamespace)
1120
- end
1121
- def create_module(name, final: false, sealed: false, interface: false, abstract: false, &block); end
1122
-
1123
- sig do
1124
- params(
1125
- name: String,
1126
- parameters: T.nilable(T::Array[Parameter]),
1127
- return_type: T.nilable(Types::TypeLike),
1128
- returns: T.nilable(Types::TypeLike),
1129
- abstract: T::Boolean,
1130
- implementation: T::Boolean,
1131
- override: T::Boolean,
1132
- overridable: T::Boolean,
1133
- class_method: T::Boolean,
1134
- final: T::Boolean,
1135
- type_parameters: T.nilable(T::Array[Symbol]),
1136
- block: T.nilable(T.proc.params(x: Method).void)
1137
- ).returns(Method)
1138
- end
1139
- def create_method(name, parameters: nil, return_type: nil, returns: nil, abstract: false, implementation: false, override: false, overridable: false, class_method: false, final: false, type_parameters: nil, &block); end
1140
-
1141
- sig do
1142
- params(
1143
- name: String,
1144
- kind: Symbol,
1145
- type: Types::TypeLike,
1146
- class_attribute: T::Boolean,
1147
- block: T.nilable(T.proc.params(x: Attribute).void)
1148
- ).returns(Attribute)
1149
- end
1150
- def create_attribute(name, kind:, type:, class_attribute: false, &block); end
1151
-
1152
- sig do
1153
- params(
1154
- name: String,
1155
- type: Types::TypeLike,
1156
- class_attribute: T::Boolean,
1157
- block: T.nilable(T.proc.params(x: Attribute).void)
1158
- ).returns(Attribute)
1159
- end
1160
- def create_attr_reader(name, type:, class_attribute: false, &block); end
1161
-
1162
- sig do
1163
- params(
1164
- name: String,
1165
- type: Types::TypeLike,
1166
- class_attribute: T::Boolean,
1167
- block: T.nilable(T.proc.params(x: Attribute).void)
1168
- ).returns(Attribute)
1169
- end
1170
- def create_attr_writer(name, type:, class_attribute: false, &block); end
1171
-
1172
- sig do
1173
- params(
1174
- name: String,
1175
- type: Types::TypeLike,
1176
- class_attribute: T::Boolean,
1177
- block: T.nilable(T.proc.params(x: Attribute).void)
1178
- ).returns(Attribute)
1179
- end
1180
- def create_attr_accessor(name, type:, class_attribute: false, &block); end
1181
-
1182
- sig { params(code: T.untyped, block: T.untyped).returns(T.untyped) }
1183
- def create_arbitrary(code:, &block); end
1184
-
1185
- sig { params(name: String, block: T.nilable(T.proc.params(x: Extend).void)).returns(RbiGenerator::Extend) }
1186
- def create_extend(name, &block); end
1187
-
1188
- sig { params(extendables: T::Array[String]).returns(T::Array[Extend]) }
1189
- def create_extends(extendables); end
1190
-
1191
- sig { params(name: String, block: T.nilable(T.proc.params(x: Include).void)).returns(Include) }
1192
- def create_include(name, &block); end
1193
-
1194
- sig { params(includables: T::Array[String]).returns(T::Array[Include]) }
1195
- def create_includes(includables); end
1196
-
1197
- sig do
1198
- params(
1199
- name: String,
1200
- value: String,
1201
- eigen_constant: T::Boolean,
1202
- block: T.nilable(T.proc.params(x: Constant).void)
1203
- ).returns(Constant)
1204
- end
1205
- def create_constant(name, value:, eigen_constant: false, &block); end
1206
-
1207
- sig { params(name: String, type: Types::TypeLike, block: T.nilable(T.proc.params(x: TypeAlias).void)).returns(TypeAlias) }
1208
- def create_type_alias(name, type:, &block); end
1209
-
1210
- sig { override.overridable.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
1211
- def mergeable?(others); end
1212
-
1213
- sig { override.overridable.params(others: T::Array[RbiGenerator::RbiObject]).void }
1214
- def merge_into_self(others); end
1215
-
1216
- sig { override.overridable.returns(String) }
1217
- def describe; end
1218
-
1219
- sig { override.void }
1220
- def generalize_from_rbi!; end
1221
-
1222
- sig { overridable.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1223
- def generate_body(indent_level, options); end
1224
-
1225
- sig { params(object: RbiObject).void }
1226
- def move_next_comments(object); end
1227
- end
1228
-
1229
- class Parameter
1230
- extend T::Sig
1231
- PREFIXES = T.let({
1232
- normal: '',
1233
- splat: '*',
1234
- double_splat: '**',
1235
- block: '&'
1236
- }.freeze, T::Hash[Symbol, String])
1237
-
1238
- sig { params(name: String, type: T.nilable(Types::TypeLike), default: T.nilable(String)).void }
1239
- def initialize(name, type: nil, default: nil); end
1240
-
1241
- sig { params(other: Object).returns(T::Boolean) }
1242
- def ==(other); end
1243
-
1244
- sig { returns(String) }
1245
- attr_reader :name
1246
-
1247
- sig { returns(String) }
1248
- def name_without_kind; end
1249
-
1250
- sig { returns(Types::TypeLike) }
1251
- attr_reader :type
1252
-
1253
- sig { returns(T.nilable(String)) }
1254
- attr_reader :default
1255
-
1256
- sig { returns(Symbol) }
1257
- attr_reader :kind
1258
-
1259
- sig { returns(String) }
1260
- def to_def_param; end
1261
-
1262
- sig { returns(String) }
1263
- def to_sig_param; end
1264
-
1265
- sig { void }
1266
- def generalize_from_rbi!; end
1267
- end
1268
-
1269
- class RbiObject < TypedObject
1270
- abstract!
1271
-
1272
- sig { params(generator: Generator, name: String).void }
1273
- def initialize(generator, name); end
1274
-
1275
- sig { returns(Generator) }
1276
- attr_reader :generator
1277
-
1278
- sig { abstract.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1279
- def generate_rbi(indent_level, options); end
1280
-
1281
- sig { abstract.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
1282
- def mergeable?(others); end
1283
-
1284
- sig { abstract.params(others: T::Array[RbiGenerator::RbiObject]).void }
1285
- def merge_into_self(others); end
1286
-
1287
- sig { override.overridable.returns(String) }
1288
- def describe; end
1289
-
1290
- sig { abstract.void }
1291
- def generalize_from_rbi!; end
1292
- end
1293
-
1294
- class StructClassNamespace < ClassNamespace
1295
- extend T::Sig
1296
-
1297
- sig do
1298
- params(
1299
- generator: Generator,
1300
- name: String,
1301
- final: T::Boolean,
1302
- sealed: T::Boolean,
1303
- props: T::Array[StructProp],
1304
- abstract: T::Boolean,
1305
- block: T.nilable(T.proc.params(x: StructClassNamespace).void)
1306
- ).void
1307
- end
1308
- def initialize(generator, name, final, sealed, props, abstract, &block); end
1309
-
1310
- sig { returns(T::Array[StructProp]) }
1311
- attr_reader :props
1312
-
1313
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1314
- def generate_body(indent_level, options); end
1315
-
1316
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
1317
- def mergeable?(others); end
1318
-
1319
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
1320
- def merge_into_self(others); end
1321
-
1322
- sig { override.void }
1323
- def generalize_from_rbi!; end
1324
- end
1325
-
1326
- class StructProp
1327
- extend T::Sig
1328
- EXTRA_PROPERTIES = T.let(%i{
1329
- optional enum dont_store foreign default factory immutable array override redaction
1330
- }, T::Array[Symbol])
1331
-
1332
- sig do
1333
- params(
1334
- name: String,
1335
- type: Types::TypeLike,
1336
- optional: T.nilable(T.any(T::Boolean, Symbol)),
1337
- enum: T.nilable(String),
1338
- dont_store: T.nilable(T::Boolean),
1339
- foreign: T.nilable(String),
1340
- default: T.nilable(String),
1341
- factory: T.nilable(String),
1342
- immutable: T.nilable(T::Boolean),
1343
- array: T.nilable(String),
1344
- override: T.nilable(T::Boolean),
1345
- redaction: T.nilable(String)
1346
- ).void
1347
- end
1348
- def initialize(name, type, optional: nil, enum: nil, dont_store: nil, foreign: nil, default: nil, factory: nil, immutable: nil, array: nil, override: nil, redaction: nil); end
1349
-
1350
- sig { params(other: Object).returns(T::Boolean) }
1351
- def ==(other); end
1352
-
1353
- sig { returns(String) }
1354
- attr_reader :name
1355
-
1356
- sig { returns(Types::TypeLike) }
1357
- attr_reader :type
1358
-
1359
- sig { returns(T.nilable(T.any(T::Boolean, Symbol))) }
1360
- attr_reader :optional
1361
-
1362
- sig { returns(T.nilable(String)) }
1363
- attr_reader :enum
1364
-
1365
- sig { returns(T.nilable(T::Boolean)) }
1366
- attr_reader :dont_store
1367
-
1368
- sig { returns(T.nilable(String)) }
1369
- attr_reader :foreign
1370
-
1371
- sig { returns(T.nilable(String)) }
1372
- attr_reader :default
1373
-
1374
- sig { returns(T.nilable(String)) }
1375
- attr_reader :factory
1376
-
1377
- sig { returns(T.nilable(T::Boolean)) }
1378
- attr_reader :immutable
1379
-
1380
- sig { returns(T.nilable(String)) }
1381
- attr_reader :array
1382
-
1383
- sig { returns(T.nilable(T::Boolean)) }
1384
- attr_reader :override
1385
-
1386
- sig { returns(T.nilable(String)) }
1387
- attr_reader :redaction
1388
-
1389
- sig { returns(String) }
1390
- def to_prop_call; end
1391
-
1392
- sig { void }
1393
- def generalize_from_rbi!; end
1394
- end
1395
-
1396
- class TypeAlias < RbiObject
1397
- sig do
1398
- params(
1399
- generator: Generator,
1400
- name: String,
1401
- type: Types::TypeLike,
1402
- block: T.nilable(T.proc.params(x: TypeAlias).void)
1403
- ).void
1404
- end
1405
- def initialize(generator, name:, type:, &block); end
1406
-
1407
- sig { returns(Types::TypeLike) }
1408
- attr_reader :type
1409
-
1410
- sig { params(other: Object).returns(T::Boolean) }
1411
- def ==(other); end
1412
-
1413
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1414
- def generate_rbi(indent_level, options); end
1415
-
1416
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).returns(T::Boolean) }
1417
- def mergeable?(others); end
1418
-
1419
- sig { override.params(others: T::Array[RbiGenerator::RbiObject]).void }
1420
- def merge_into_self(others); end
1421
-
1422
- sig { override.returns(String) }
1423
- def describe; end
1424
-
1425
- sig { override.void }
1426
- def generalize_from_rbi!; end
1427
- end
1428
- end
1429
-
1430
- class RbsGenerator < Generator
1431
- sig { params(hash: T.untyped).returns(T.untyped) }
1432
- def initialize(**hash); end
1433
-
1434
- sig { returns(RbsGenerator::Namespace) }
1435
- attr_reader :root
1436
-
1437
- sig { overridable.returns(String) }
1438
- def rbs; end
1439
-
1440
- class Arbitrary < RbsObject
1441
- sig { params(generator: Generator, code: String, block: T.nilable(T.proc.params(x: Arbitrary).void)).void }
1442
- def initialize(generator, code: '', &block); end
1443
-
1444
- sig { returns(String) }
1445
- attr_accessor :code
1446
-
1447
- sig { params(other: Object).returns(T::Boolean) }
1448
- def ==(other); end
1449
-
1450
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1451
- def generate_rbs(indent_level, options); end
1452
-
1453
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).returns(T::Boolean) }
1454
- def mergeable?(others); end
1455
-
1456
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).void }
1457
- def merge_into_self(others); end
1458
-
1459
- sig { override.returns(String) }
1460
- def describe; end
1461
- end
1462
-
1463
- class Attribute < RbsGenerator::Method
1464
- extend T::Sig
1465
-
1466
- sig do
1467
- params(
1468
- generator: Generator,
1469
- name: String,
1470
- kind: Symbol,
1471
- type: Types::TypeLike,
1472
- block: T.nilable(T.proc.params(x: Attribute).void)
1473
- ).void
1474
- end
1475
- def initialize(generator, name, kind, type, &block); end
1476
-
1477
- sig { returns(Symbol) }
1478
- attr_reader :kind
1479
-
1480
- sig { returns(Types::TypeLike) }
1481
- attr_reader :type
1482
-
1483
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1484
- def generate_rbs(indent_level, options); end
1485
-
1486
- sig { override.params(other: Object).returns(T::Boolean) }
1487
- def ==(other); end
1488
- end
1489
-
1490
- class Block
1491
- extend T::Sig
1492
-
1493
- sig { params(type: Types::Proc, required: T::Boolean).void }
1494
- def initialize(type, required); end
1495
-
1496
- sig { overridable.params(other: Object).returns(T::Boolean) }
1497
- def ==(other); end
1498
-
1499
- sig { returns(Types::Proc) }
1500
- attr_reader :type
1501
-
1502
- sig { returns(T::Boolean) }
1503
- attr_reader :required
1504
-
1505
- sig { params(options: Options).returns(T::Array[String]) }
1506
- def generate_rbs(options); end
1507
- end
1508
-
1509
- class ClassNamespace < Namespace
1510
- extend T::Sig
1511
-
1512
- sig do
1513
- params(
1514
- generator: Generator,
1515
- name: String,
1516
- superclass: T.nilable(Types::TypeLike),
1517
- block: T.nilable(T.proc.params(x: ClassNamespace).void)
1518
- ).void
1519
- end
1520
- def initialize(generator, name, superclass, &block); end
1521
-
1522
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1523
- def generate_rbs(indent_level, options); end
1524
-
1525
- sig { returns(T.nilable(Types::TypeLike)) }
1526
- attr_reader :superclass
1527
-
1528
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).returns(T::Boolean) }
1529
- def mergeable?(others); end
1530
-
1531
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).void }
1532
- def merge_into_self(others); end
1533
-
1534
- sig { override.returns(String) }
1535
- def describe; end
1536
- end
1537
-
1538
- class Constant < RbsObject
1539
- sig do
1540
- params(
1541
- generator: Generator,
1542
- name: String,
1543
- type: Types::TypeLike,
1544
- block: T.nilable(T.proc.params(x: Constant).void)
1545
- ).void
1546
- end
1547
- def initialize(generator, name, type:, &block); end
1548
-
1549
- sig { returns(Types::TypeLike) }
1550
- attr_reader :type
1551
-
1552
- sig { params(other: Object).returns(T::Boolean) }
1553
- def ==(other); end
1554
-
1555
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1556
- def generate_rbs(indent_level, options); end
1557
-
1558
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).returns(T::Boolean) }
1559
- def mergeable?(others); end
1560
-
1561
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).void }
1562
- def merge_into_self(others); end
1563
-
1564
- sig { override.returns(String) }
1565
- def describe; end
1566
- end
1567
-
1568
- class Extend < RbsObject
1569
- sig { params(generator: Generator, type: Types::TypeLike, block: T.nilable(T.proc.params(x: Extend).void)).void }
1570
- def initialize(generator, type:, &block); end
1571
-
1572
- sig { params(other: Object).returns(T::Boolean) }
1573
- def ==(other); end
1574
-
1575
- sig { returns(Types::TypeLike) }
1576
- attr_reader :type
1577
-
1578
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1579
- def generate_rbs(indent_level, options); end
1580
-
1581
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).returns(T::Boolean) }
1582
- def mergeable?(others); end
1583
-
1584
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).void }
1585
- def merge_into_self(others); end
1586
-
1587
- sig { override.returns(String) }
1588
- def describe; end
1589
- end
1590
-
1591
- class Include < RbsObject
1592
- sig { params(generator: Generator, type: Types::TypeLike, block: T.nilable(T.proc.params(x: Include).void)).void }
1593
- def initialize(generator, type:, &block); end
1594
-
1595
- sig { params(other: Object).returns(T::Boolean) }
1596
- def ==(other); end
1597
-
1598
- sig { returns(Types::TypeLike) }
1599
- attr_reader :type
1600
-
1601
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1602
- def generate_rbs(indent_level, options); end
1603
-
1604
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).returns(T::Boolean) }
1605
- def mergeable?(others); end
1606
-
1607
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).void }
1608
- def merge_into_self(others); end
1609
-
1610
- sig { override.returns(String) }
1611
- def describe; end
1612
- end
1613
-
1614
- class InterfaceNamespace < Namespace
1615
- extend T::Sig
1616
-
1617
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1618
- def generate_rbs(indent_level, options); end
1619
-
1620
- sig { override.returns(String) }
1621
- def describe; end
1622
- end
1623
-
1624
- class Method < RbsObject
1625
- extend T::Sig
1626
-
1627
- sig do
1628
- params(
1629
- generator: Generator,
1630
- name: String,
1631
- signatures: T::Array[MethodSignature],
1632
- class_method: T::Boolean,
1633
- block: T.nilable(T.proc.params(x: Method).void)
1634
- ).void
1635
- end
1636
- def initialize(generator, name, signatures, class_method: false, &block); end
1637
-
1638
- sig { overridable.params(other: Object).returns(T::Boolean) }
1639
- def ==(other); end
1640
-
1641
- sig { returns(T::Array[MethodSignature]) }
1642
- attr_reader :signatures
1643
-
1644
- sig { returns(T::Boolean) }
1645
- attr_reader :class_method
1646
-
1647
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1648
- def generate_rbs(indent_level, options); end
1649
-
1650
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).returns(T::Boolean) }
1651
- def mergeable?(others); end
1652
-
1653
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).void }
1654
- def merge_into_self(others); end
1655
-
1656
- sig { override.returns(String) }
1657
- def describe; end
1658
- end
1659
-
1660
- class MethodSignature
1661
- extend T::Sig
1662
-
1663
- sig do
1664
- params(
1665
- parameters: T::Array[Parameter],
1666
- return_type: T.nilable(Types::TypeLike),
1667
- block: T.nilable(Block),
1668
- type_parameters: T.nilable(T::Array[Symbol])
1669
- ).void
1670
- end
1671
- def initialize(parameters, return_type = nil, block: nil, type_parameters: nil); end
1672
-
1673
- sig { overridable.params(other: Object).returns(T::Boolean) }
1674
- def ==(other); end
1675
-
1676
- sig { returns(T::Array[Parameter]) }
1677
- attr_reader :parameters
1678
-
1679
- sig { returns(T.nilable(Types::TypeLike)) }
1680
- attr_reader :return_type
1681
-
1682
- sig { returns(T.nilable(Block)) }
1683
- attr_reader :block
1684
-
1685
- sig { returns(T::Array[Symbol]) }
1686
- attr_reader :type_parameters
1687
-
1688
- sig { params(options: Options).returns(T::Array[String]) }
1689
- def generate_rbs(options); end
1690
- end
1691
-
1692
- class ModuleNamespace < Namespace
1693
- extend T::Sig
1694
-
1695
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1696
- def generate_rbs(indent_level, options); end
1697
-
1698
- sig { override.returns(String) }
1699
- def describe; end
1700
- end
1701
-
1702
- class Namespace < RbsObject
1703
- extend T::Sig
1704
-
1705
- sig { override.overridable.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1706
- def generate_rbs(indent_level, options); end
1707
-
1708
- sig { params(generator: Generator, name: T.nilable(String), block: T.nilable(T.proc.params(x: Namespace).void)).void }
1709
- def initialize(generator, name = nil, &block); end
1710
-
1711
- sig { returns(T::Array[RbsObject]) }
1712
- attr_reader :children
1713
-
1714
- sig { returns(T::Array[RbsGenerator::Extend]) }
1715
- def extends; end
1716
-
1717
- sig { returns(T::Array[RbsGenerator::Include]) }
1718
- def includes; end
1719
-
1720
- sig { returns(T::Array[RbsGenerator::TypeAlias]) }
1721
- def aliases; end
1722
-
1723
- sig { returns(T::Array[RbsGenerator::Constant]) }
1724
- def constants; end
1725
-
1726
- sig { params(object: T.untyped, block: T.proc.params(x: Namespace).void).void }
1727
- def path(object, &block); end
1728
-
1729
- sig { params(comment: T.any(String, T::Array[String])).void }
1730
- def add_comment_to_next_child(comment); end
1731
-
1732
- sig { params(name: String, superclass: T.nilable(Types::TypeLike), block: T.nilable(T.proc.params(x: ClassNamespace).void)).returns(ClassNamespace) }
1733
- def create_class(name, superclass: nil, &block); end
1734
-
1735
- sig { params(name: String, block: T.nilable(T.proc.params(x: Namespace).void)).returns(ModuleNamespace) }
1736
- def create_module(name, &block); end
1737
-
1738
- sig { params(name: String, block: T.nilable(T.proc.params(x: Namespace).void)).returns(InterfaceNamespace) }
1739
- def create_interface(name, &block); end
1740
-
1741
- sig do
1742
- params(
1743
- name: String,
1744
- signatures: T.nilable(T::Array[MethodSignature]),
1745
- class_method: T::Boolean,
1746
- block: T.nilable(T.proc.params(x: Method).void)
1747
- ).returns(Method)
1748
- end
1749
- def create_method(name, signatures = nil, class_method: false, &block); end
1750
-
1751
- sig do
1752
- params(
1753
- name: String,
1754
- kind: Symbol,
1755
- type: Types::TypeLike,
1756
- block: T.nilable(T.proc.params(x: Attribute).void)
1757
- ).returns(Attribute)
1758
- end
1759
- def create_attribute(name, kind:, type:, &block); end
1760
-
1761
- sig { params(name: String, type: Types::TypeLike, block: T.nilable(T.proc.params(x: Attribute).void)).returns(Attribute) }
1762
- def create_attr_reader(name, type:, &block); end
1763
-
1764
- sig { params(name: String, type: Types::TypeLike, block: T.nilable(T.proc.params(x: Attribute).void)).returns(Attribute) }
1765
- def create_attr_writer(name, type:, &block); end
1766
-
1767
- sig { params(name: String, type: Types::TypeLike, block: T.nilable(T.proc.params(x: Attribute).void)).returns(Attribute) }
1768
- def create_attr_accessor(name, type:, &block); end
1769
-
1770
- sig { params(code: T.untyped, block: T.untyped).returns(T.untyped) }
1771
- def create_arbitrary(code:, &block); end
1772
-
1773
- sig { params(type: Types::TypeLike, block: T.nilable(T.proc.params(x: Extend).void)).returns(RbsGenerator::Extend) }
1774
- def create_extend(type, &block); end
1775
-
1776
- sig { params(extendables: T::Array[Types::TypeLike]).returns(T::Array[Extend]) }
1777
- def create_extends(extendables); end
1778
-
1779
- sig { params(type: Types::TypeLike, block: T.nilable(T.proc.params(x: Include).void)).returns(Include) }
1780
- def create_include(type, &block); end
1781
-
1782
- sig { params(includables: T::Array[Types::TypeLike]).returns(T::Array[Include]) }
1783
- def create_includes(includables); end
1784
-
1785
- sig { params(name: String, type: Types::TypeLike, block: T.nilable(T.proc.params(x: Constant).void)).returns(Constant) }
1786
- def create_constant(name, type:, &block); end
1787
-
1788
- sig { params(name: String, type: Types::TypeLike, block: T.nilable(T.proc.params(x: TypeAlias).void)).returns(TypeAlias) }
1789
- def create_type_alias(name, type:, &block); end
1790
-
1791
- sig { override.overridable.params(others: T::Array[RbsGenerator::RbsObject]).returns(T::Boolean) }
1792
- def mergeable?(others); end
1793
-
1794
- sig { override.overridable.params(others: T::Array[RbsGenerator::RbsObject]).void }
1795
- def merge_into_self(others); end
1796
-
1797
- sig { override.overridable.returns(String) }
1798
- def describe; end
1799
-
1800
- sig { overridable.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1801
- def generate_body(indent_level, options); end
1802
-
1803
- sig { params(object: RbsObject).void }
1804
- def move_next_comments(object); end
1805
- end
1806
-
1807
- class Parameter
1808
- extend T::Sig
1809
- RBS_KEYWORDS = [
1810
- 'type', 'interface', 'out', 'in', 'instance', 'extension', 'top', 'bot',
1811
- 'self', 'nil', 'void'
1812
- ]
1813
- PREFIXES = {
1814
- normal: '',
1815
- splat: '*',
1816
- double_splat: '**',
1817
- }.freeze
1818
-
1819
- sig { params(name: String, type: T.nilable(Types::TypeLike), required: T::Boolean).void }
1820
- def initialize(name, type: nil, required: true); end
1821
-
1822
- sig { params(other: Object).returns(T::Boolean) }
1823
- def ==(other); end
1824
-
1825
- sig { returns(String) }
1826
- attr_reader :name
1827
-
1828
- sig { returns(String) }
1829
- def name_without_kind; end
1830
-
1831
- sig { returns(Types::TypeLike) }
1832
- attr_reader :type
1833
-
1834
- sig { returns(T::Boolean) }
1835
- attr_reader :required
1836
-
1837
- sig { returns(Symbol) }
1838
- attr_reader :kind
1839
-
1840
- sig { returns(String) }
1841
- def to_rbs_param; end
1842
- end
1843
-
1844
- class RbsObject < TypedObject
1845
- abstract!
1846
-
1847
- sig { params(generator: Generator, name: String).void }
1848
- def initialize(generator, name); end
1849
-
1850
- sig { returns(Generator) }
1851
- attr_reader :generator
1852
-
1853
- sig { abstract.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1854
- def generate_rbs(indent_level, options); end
1855
-
1856
- sig { abstract.params(others: T::Array[RbsGenerator::RbsObject]).returns(T::Boolean) }
1857
- def mergeable?(others); end
1858
-
1859
- sig { abstract.params(others: T::Array[RbsGenerator::RbsObject]).void }
1860
- def merge_into_self(others); end
1861
-
1862
- sig { override.overridable.returns(String) }
1863
- def describe; end
1864
- end
1865
-
1866
- class TypeAlias < RbsObject
1867
- sig do
1868
- params(
1869
- generator: Generator,
1870
- name: String,
1871
- type: Types::TypeLike,
1872
- block: T.nilable(T.proc.params(x: TypeAlias).void)
1873
- ).void
1874
- end
1875
- def initialize(generator, name:, type:, &block); end
1876
-
1877
- sig { returns(Types::TypeLike) }
1878
- attr_reader :type
1879
-
1880
- sig { params(other: Object).returns(T::Boolean) }
1881
- def ==(other); end
1882
-
1883
- sig { override.params(indent_level: Integer, options: Options).returns(T::Array[String]) }
1884
- def generate_rbs(indent_level, options); end
1885
-
1886
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).returns(T::Boolean) }
1887
- def mergeable?(others); end
1888
-
1889
- sig { override.params(others: T::Array[RbsGenerator::RbsObject]).void }
1890
- def merge_into_self(others); end
1891
-
1892
- sig { override.returns(String) }
1893
- def describe; end
1894
- end
1895
- end
1896
- end