rbs_active_hash 1.4.1 → 1.6.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.
@@ -5,18 +5,23 @@ require "active_hash"
5
5
 
6
6
  module RbsActiveHash
7
7
  module ActiveHash
8
- def self.user_defined_model?(klass)
8
+ # @rbs klass: singleton(ActiveHash::Base)
9
+ def self.user_defined_model?(klass) #: bool
9
10
  klass.name !~ /^Active(Hash|File|JSON|Yaml)::/
10
11
  end
11
12
 
12
- def self.class_to_rbs(klass)
13
+ # @rbs klass: singleton(ActiveHash::Base) -> String
14
+ def self.class_to_rbs(klass) #: String
13
15
  Generator.new(klass).generate
14
16
  end
15
17
 
16
18
  class Generator
17
- attr_reader :klass, :klass_name, :parser
19
+ attr_reader :klass #: singleton(ActiveHash::Base)
20
+ attr_reader :klass_name #: String
21
+ attr_reader :parser #: ActiveHash::Parser::Parser
18
22
 
19
- def initialize(klass)
23
+ # @rbs klass: singleton(ActiveHash::Base)
24
+ def initialize(klass) #: void
20
25
  @klass = klass
21
26
  @klass_name = klass.name || ""
22
27
  @parser = ActiveHash::Parser::Parser.new
@@ -24,10 +29,10 @@ module RbsActiveHash
24
29
  path, = Object.const_source_location(klass_name)
25
30
  return unless path
26
31
 
27
- @parser.parse(IO.read(path.to_s), klass_name.split("::").map(&:to_sym))
32
+ @parser.parse(File.read(path), klass_name.split("::").map(&:to_sym))
28
33
  end
29
34
 
30
- def generate
35
+ def generate #: String
31
36
  if klass < ::ActiveFile::Base
32
37
  begin
33
38
  klass.reload
@@ -41,14 +46,15 @@ module RbsActiveHash
41
46
 
42
47
  private
43
48
 
44
- def format(rbs)
49
+ # @rbs rbs: String
50
+ def format(rbs) #: String
45
51
  parsed = RBS::Parser.parse_signature(rbs)
46
52
  StringIO.new.tap do |out|
47
53
  RBS::Writer.new(out: out).write(parsed[1] + parsed[2])
48
54
  end.string
49
55
  end
50
56
 
51
- def klass_decl
57
+ def klass_decl #: String
52
58
  <<~RBS
53
59
  #{header}
54
60
  #{enum_decls}
@@ -59,7 +65,7 @@ module RbsActiveHash
59
65
  RBS
60
66
  end
61
67
 
62
- def header
68
+ def header #: String
63
69
  namespace = +""
64
70
  klass_name.split("::").map do |mod_name|
65
71
  namespace += "::#{mod_name}"
@@ -79,13 +85,13 @@ module RbsActiveHash
79
85
  end.join("\n")
80
86
  end
81
87
 
82
- def module_names
88
+ def module_names #: String
83
89
  klass.module_parents.reverse[1..].map do |mod|
84
90
  mod.name.split("::").last
85
91
  end
86
92
  end
87
93
 
88
- def enum_decls
94
+ def enum_decls #: String?
89
95
  return unless klass.ancestors.include? ::ActiveHash::Enum
90
96
 
91
97
  <<~RBS
@@ -96,7 +102,7 @@ module RbsActiveHash
96
102
  RBS
97
103
  end
98
104
 
99
- def constants
105
+ def constants #: Array[String]
100
106
  enum_accessors = klass.instance_eval { @enum_accessors }
101
107
  return [] unless enum_accessors
102
108
 
@@ -111,17 +117,18 @@ module RbsActiveHash
111
117
  end
112
118
  end
113
119
 
114
- def scope_decls
120
+ def scope_decls #: String?
115
121
  return if parser.scopes.empty?
116
122
 
117
- parser.scopes.map do |scope_id, _|
118
- <<~RBS
119
- def self.#{scope_id}: () -> ActiveHash::Relation[instance]
123
+ parser.scopes.map do |scope_id, args|
124
+ arguments = args.map { |arg| "untyped #{arg}" }.join(", ")
125
+ <<~RBS.strip
126
+ def self.#{scope_id}: (#{arguments}) -> ActiveHash::Relation[instance]
120
127
  RBS
121
128
  end.join("\n")
122
129
  end
123
130
 
124
- def association_decls
131
+ def association_decls #: String?
125
132
  return unless klass.ancestors.include? ::ActiveHash::Associations
126
133
 
127
134
  <<~RBS
@@ -134,7 +141,8 @@ module RbsActiveHash
134
141
  RBS
135
142
  end
136
143
 
137
- def has_many_decls(definitions) # rubocop:disable Naming/PredicateName
144
+ # @rbs definitions: Array[[Symbol, Hash[untyped, untyped]]]
145
+ def has_many_decls(definitions) #: String # rubocop:disable Naming/PredicatePrefix
138
146
  definitions.map do |definition|
139
147
  association_id, options = definition
140
148
  klass = options.fetch(:class_name, association_id.to_s.classify).constantize
@@ -152,7 +160,8 @@ module RbsActiveHash
152
160
  end.join("\n")
153
161
  end
154
162
 
155
- def has_one_decls(definitions) # rubocop:disable Naming/PredicateName
163
+ # @rbs definitions: Array[[Symbol, Hash[untyped, untyped]]]
164
+ def has_one_decls(definitions) #: String # rubocop:disable Naming/PredicatePrefix
156
165
  definitions.map do |definition|
157
166
  association_id, options = definition
158
167
  class_name = options.fetch(:class_name, association_id.to_s.classify).constantize
@@ -161,7 +170,8 @@ module RbsActiveHash
161
170
  end.join("\n")
162
171
  end
163
172
 
164
- def belongs_to_decls(definitions)
173
+ # @rbs definitions: Array[[Symbol, Hash[untyped, untyped]]]
174
+ def belongs_to_decls(definitions) #: String
165
175
  definitions.map do |definition|
166
176
  association_id, options = definition
167
177
  class_name = options.fetch(:class_name, association_id.to_s.classify).constantize
@@ -173,7 +183,7 @@ module RbsActiveHash
173
183
  end.join("\n")
174
184
  end
175
185
 
176
- def method_decls
186
+ def method_decls #: String
177
187
  method_names.map do |method|
178
188
  method_type = stringify_type(method_types.fetch(method, "untyped"))
179
189
  if method == :id
@@ -190,32 +200,34 @@ module RbsActiveHash
190
200
  end.join("\n")
191
201
  end
192
202
 
193
- def method_names
203
+ def method_names #: Array[Symbol]
194
204
  method_names = (klass.data || []).flat_map do |record|
195
205
  record.symbolize_keys.keys
196
206
  end
197
207
  method_names.uniq.select { |k| valid_field_name?(k) }
198
208
  end
199
209
 
200
- def method_types
201
- method_types = Hash.new { |hash, key| hash[key] = [] }
210
+ def method_types #: Hash[Symbol, untyped]
211
+ method_types = Hash.new { |hash, key| hash[key] = [] } # steep:ignore
202
212
  (klass.data || []).each do |record|
203
213
  record.symbolize_keys.each do |key, value|
204
- method_types[key] << identify_class(value)
214
+ method_types[key] << identify_class(value) # steep:ignore
205
215
  end
206
216
  end
207
217
  method_types.transform_values(&:uniq)
208
218
  end
209
219
 
210
- def valid_field_name?(name)
220
+ # @rbs name: String | Symbol
221
+ def valid_field_name?(name) #: boolish
211
222
  name.to_s =~ /^[a-zA-Z_][a-zA-Z0-9_]*$/
212
223
  end
213
224
 
214
- def footer
225
+ def footer #: String
215
226
  "end\n" * klass.module_parents.size
216
227
  end
217
228
 
218
- def identify_class(obj)
229
+ # @rbs obj: untyped
230
+ def identify_class(obj) #: String | singleton(Class)
219
231
  case obj
220
232
  when Array
221
233
  args = obj.map(&:class)
@@ -229,7 +241,8 @@ module RbsActiveHash
229
241
  end
230
242
  end
231
243
 
232
- def stringify_type(type)
244
+ # @rbs type: untyped
245
+ def stringify_type(type) #: String
233
246
  if [TrueClass, FalseClass].include?(type)
234
247
  "bool"
235
248
  elsif type == NilClass
@@ -6,9 +6,12 @@ require "rake/tasklib"
6
6
 
7
7
  module RbsActiveHash
8
8
  class RakeTask < Rake::TaskLib
9
- attr_accessor :name, :signature_root_dir
9
+ attr_accessor :name #: Symbol
10
+ attr_accessor :signature_root_dir #: Pathname
10
11
 
11
- def initialize(name = :"rbs:active_hash", &block)
12
+ # @rbs name: Symbol
13
+ # @rbs &block: (RakeTask) -> void
14
+ def initialize(name = :"rbs:active_hash", &block) #: void
12
15
  super()
13
16
 
14
17
  @name = name
@@ -22,24 +25,24 @@ module RbsActiveHash
22
25
  define_setup_task
23
26
  end
24
27
 
25
- def define_setup_task
28
+ def define_setup_task #: void
26
29
  desc "Run all tasks of rbs_active_hash"
27
30
 
28
31
  deps = [:"#{name}:clean", :"#{name}:generate"]
29
32
  task("#{name}:setup": deps)
30
33
  end
31
34
 
32
- def define_clean_task
35
+ def define_clean_task #: void
33
36
  desc "Clean up generated RBS files"
34
37
  task("#{name}:clean": :environment) do
35
38
  sh "rm", "-rf", @signature_root_dir.to_s
36
39
  end
37
40
  end
38
41
 
39
- def define_generate_task
42
+ def define_generate_task #: void
40
43
  desc "Generate RBS files for ActiveHash models"
41
44
  task("#{name}:generate": :environment) do
42
- require "rbs_active_hash" # load RbsActiveHash lazily
45
+ require "rbs_active_hash" # load RbsActiveHash lazily
43
46
 
44
47
  Rails.application.eager_load!
45
48
 
@@ -55,7 +58,7 @@ module RbsActiveHash
55
58
 
56
59
  private
57
60
 
58
- def setup_signature_root_dir!
61
+ def setup_signature_root_dir! #: void
59
62
  @signature_root_dir ||= Pathname(Rails.root / "sig/active_hash")
60
63
  @signature_root_dir.mkpath
61
64
  @signature_root_dir
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbsActiveHash
4
- VERSION = "1.4.1"
4
+ VERSION = "1.6.0"
5
5
  end
@@ -1,22 +1,12 @@
1
1
  ---
2
- sources:
3
- - type: git
4
- name: ruby/gem_rbs_collection
5
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
6
- remote: https://github.com/ruby/gem_rbs_collection.git
7
- repo_dir: gems
8
2
  path: ".gem_rbs_collection"
9
3
  gems:
10
- - name: abbrev
11
- version: '0'
12
- source:
13
- type: stdlib
14
4
  - name: actionpack
15
- version: '6.0'
5
+ version: '7.2'
16
6
  source:
17
7
  type: git
18
8
  name: ruby/gem_rbs_collection
19
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
9
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
20
10
  remote: https://github.com/ruby/gem_rbs_collection.git
21
11
  repo_dir: gems
22
12
  - name: actionview
@@ -24,7 +14,7 @@ gems:
24
14
  source:
25
15
  type: git
26
16
  name: ruby/gem_rbs_collection
27
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
17
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
28
18
  remote: https://github.com/ruby/gem_rbs_collection.git
29
19
  repo_dir: gems
30
20
  - name: active_hash
@@ -32,23 +22,23 @@ gems:
32
22
  source:
33
23
  type: git
34
24
  name: ruby/gem_rbs_collection
35
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
25
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
36
26
  remote: https://github.com/ruby/gem_rbs_collection.git
37
27
  repo_dir: gems
38
28
  - name: activemodel
39
- version: '7.0'
29
+ version: '7.1'
40
30
  source:
41
31
  type: git
42
32
  name: ruby/gem_rbs_collection
43
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
33
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
44
34
  remote: https://github.com/ruby/gem_rbs_collection.git
45
35
  repo_dir: gems
46
36
  - name: activerecord
47
- version: '7.0'
37
+ version: '7.2'
48
38
  source:
49
39
  type: git
50
40
  name: ruby/gem_rbs_collection
51
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
41
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
52
42
  remote: https://github.com/ruby/gem_rbs_collection.git
53
43
  repo_dir: gems
54
44
  - name: activesupport
@@ -56,7 +46,7 @@ gems:
56
46
  source:
57
47
  type: git
58
48
  name: ruby/gem_rbs_collection
59
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
49
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
60
50
  remote: https://github.com/ruby/gem_rbs_collection.git
61
51
  repo_dir: gems
62
52
  - name: ast
@@ -64,13 +54,25 @@ gems:
64
54
  source:
65
55
  type: git
66
56
  name: ruby/gem_rbs_collection
67
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
57
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
68
58
  remote: https://github.com/ruby/gem_rbs_collection.git
69
59
  repo_dir: gems
70
60
  - name: base64
61
+ version: 0.3.0
62
+ source:
63
+ type: rubygems
64
+ - name: benchmark
71
65
  version: '0'
72
66
  source:
73
67
  type: stdlib
68
+ - name: bigdecimal
69
+ version: '3.1'
70
+ source:
71
+ type: git
72
+ name: ruby/gem_rbs_collection
73
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
74
+ remote: https://github.com/ruby/gem_rbs_collection.git
75
+ repo_dir: gems
74
76
  - name: cgi
75
77
  version: '0'
76
78
  source:
@@ -80,25 +82,49 @@ gems:
80
82
  source:
81
83
  type: git
82
84
  name: ruby/gem_rbs_collection
83
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
85
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
86
+ remote: https://github.com/ruby/gem_rbs_collection.git
87
+ repo_dir: gems
88
+ - name: connection_pool
89
+ version: '2.4'
90
+ source:
91
+ type: git
92
+ name: ruby/gem_rbs_collection
93
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
84
94
  remote: https://github.com/ruby/gem_rbs_collection.git
85
95
  repo_dir: gems
86
96
  - name: date
87
97
  version: '0'
88
98
  source:
89
99
  type: stdlib
100
+ - name: delegate
101
+ version: '0'
102
+ source:
103
+ type: stdlib
104
+ - name: digest
105
+ version: '0'
106
+ source:
107
+ type: stdlib
90
108
  - name: erb
91
109
  version: '0'
92
110
  source:
93
111
  type: stdlib
112
+ - name: fileutils
113
+ version: '0'
114
+ source:
115
+ type: stdlib
94
116
  - name: i18n
95
117
  version: '1.10'
96
118
  source:
97
119
  type: git
98
120
  name: ruby/gem_rbs_collection
99
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
121
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
100
122
  remote: https://github.com/ruby/gem_rbs_collection.git
101
123
  repo_dir: gems
124
+ - name: io-console
125
+ version: '0'
126
+ source:
127
+ type: stdlib
102
128
  - name: json
103
129
  version: '0'
104
130
  source:
@@ -108,25 +134,29 @@ gems:
108
134
  source:
109
135
  type: stdlib
110
136
  - name: minitest
111
- version: '0'
137
+ version: '5.25'
112
138
  source:
113
- type: stdlib
139
+ type: git
140
+ name: ruby/gem_rbs_collection
141
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
142
+ remote: https://github.com/ruby/gem_rbs_collection.git
143
+ repo_dir: gems
114
144
  - name: monitor
115
145
  version: '0'
116
146
  source:
117
147
  type: stdlib
118
- - name: mutex_m
119
- version: '0'
120
- source:
121
- type: stdlib
122
148
  - name: nokogiri
123
149
  version: '1.11'
124
150
  source:
125
151
  type: git
126
152
  name: ruby/gem_rbs_collection
127
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
153
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
128
154
  remote: https://github.com/ruby/gem_rbs_collection.git
129
155
  repo_dir: gems
156
+ - name: openssl
157
+ version: '0'
158
+ source:
159
+ type: stdlib
130
160
  - name: optparse
131
161
  version: '0'
132
162
  source:
@@ -136,7 +166,15 @@ gems:
136
166
  source:
137
167
  type: git
138
168
  name: ruby/gem_rbs_collection
139
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
169
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
170
+ remote: https://github.com/ruby/gem_rbs_collection.git
171
+ repo_dir: gems
172
+ - name: parser
173
+ version: '3.2'
174
+ source:
175
+ type: git
176
+ name: ruby/gem_rbs_collection
177
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
140
178
  remote: https://github.com/ruby/gem_rbs_collection.git
141
179
  repo_dir: gems
142
180
  - name: pathname
@@ -148,7 +186,7 @@ gems:
148
186
  source:
149
187
  type: git
150
188
  name: ruby/gem_rbs_collection
151
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
189
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
152
190
  remote: https://github.com/ruby/gem_rbs_collection.git
153
191
  repo_dir: gems
154
192
  - name: rails-dom-testing
@@ -156,7 +194,15 @@ gems:
156
194
  source:
157
195
  type: git
158
196
  name: ruby/gem_rbs_collection
159
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
197
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
198
+ remote: https://github.com/ruby/gem_rbs_collection.git
199
+ repo_dir: gems
200
+ - name: rails-html-sanitizer
201
+ version: '1.6'
202
+ source:
203
+ type: git
204
+ name: ruby/gem_rbs_collection
205
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
160
206
  remote: https://github.com/ruby/gem_rbs_collection.git
161
207
  repo_dir: gems
162
208
  - name: railties
@@ -164,7 +210,7 @@ gems:
164
210
  source:
165
211
  type: git
166
212
  name: ruby/gem_rbs_collection
167
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
213
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
168
214
  remote: https://github.com/ruby/gem_rbs_collection.git
169
215
  repo_dir: gems
170
216
  - name: rainbow
@@ -172,17 +218,49 @@ gems:
172
218
  source:
173
219
  type: git
174
220
  name: ruby/gem_rbs_collection
175
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
221
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
222
+ remote: https://github.com/ruby/gem_rbs_collection.git
223
+ repo_dir: gems
224
+ - name: rake
225
+ version: '13.0'
226
+ source:
227
+ type: git
228
+ name: ruby/gem_rbs_collection
229
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
176
230
  remote: https://github.com/ruby/gem_rbs_collection.git
177
231
  repo_dir: gems
178
232
  - name: rbs
179
- version: 3.1.3
233
+ version: 3.9.5
180
234
  source:
181
235
  type: rubygems
182
236
  - name: rdoc
183
237
  version: '0'
184
238
  source:
185
239
  type: stdlib
240
+ - name: regexp_parser
241
+ version: '2.8'
242
+ source:
243
+ type: git
244
+ name: ruby/gem_rbs_collection
245
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
246
+ remote: https://github.com/ruby/gem_rbs_collection.git
247
+ repo_dir: gems
248
+ - name: rubocop
249
+ version: '1.57'
250
+ source:
251
+ type: git
252
+ name: ruby/gem_rbs_collection
253
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
254
+ remote: https://github.com/ruby/gem_rbs_collection.git
255
+ repo_dir: gems
256
+ - name: rubocop-ast
257
+ version: '1.30'
258
+ source:
259
+ type: git
260
+ name: ruby/gem_rbs_collection
261
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
262
+ remote: https://github.com/ruby/gem_rbs_collection.git
263
+ repo_dir: gems
186
264
  - name: securerandom
187
265
  version: '0'
188
266
  source:
@@ -191,6 +269,14 @@ gems:
191
269
  version: '0'
192
270
  source:
193
271
  type: stdlib
272
+ - name: socket
273
+ version: '0'
274
+ source:
275
+ type: stdlib
276
+ - name: stringio
277
+ version: '0'
278
+ source:
279
+ type: stdlib
194
280
  - name: tempfile
195
281
  version: '0'
196
282
  source:
@@ -200,17 +286,29 @@ gems:
200
286
  source:
201
287
  type: git
202
288
  name: ruby/gem_rbs_collection
203
- revision: 8149bc3fc0f720d935dc0592dc8886e03052f65f
289
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
204
290
  remote: https://github.com/ruby/gem_rbs_collection.git
205
291
  repo_dir: gems
206
292
  - name: time
207
293
  version: '0'
208
294
  source:
209
295
  type: stdlib
296
+ - name: timeout
297
+ version: '0'
298
+ source:
299
+ type: stdlib
210
300
  - name: tsort
211
301
  version: '0'
212
302
  source:
213
303
  type: stdlib
304
+ - name: tzinfo
305
+ version: '2.0'
306
+ source:
307
+ type: git
308
+ name: ruby/gem_rbs_collection
309
+ revision: 0cb6351d218704700cf4df797ff8966b3a418fcd
310
+ remote: https://github.com/ruby/gem_rbs_collection.git
311
+ repo_dir: gems
214
312
  - name: uri
215
313
  version: '0'
216
314
  source:
@@ -1,3 +1,5 @@
1
+ # Generated from lib/generators/rbs_active_hash/install_generator.rb with RBS::Inline
2
+
1
3
  module RbsActiveHash
2
4
  class InstallGenerator < Rails::Generators::Base
3
5
  def create_raketask: () -> void
@@ -1,3 +1,5 @@
1
+ # Generated from lib/rbs_active_hash/active_hash/parser.rb with RBS::Inline
2
+
1
3
  module RbsActiveHash
2
4
  module ActiveHash
3
5
  module Parser
@@ -8,19 +10,36 @@ module RbsActiveHash
8
10
  end
9
11
 
10
12
  class RB < RBS::Prototype::RB
13
+ # @rbs override
14
+ def process: ...
11
15
  end
12
16
 
13
17
  class Parser
14
- attr_reader has_many: Array[[Symbol, Hash[untyped, untyped]]]
15
- attr_reader has_one: Array[[Symbol, Hash[untyped, untyped]]]
16
- attr_reader belongs_to: Array[[Symbol, Hash[untyped, untyped]]]
17
- attr_reader scopes: Array[[Symbol, Hash[untyped, untyped]]]
18
+ attr_reader has_many: Array[[ Symbol, Hash[untyped, untyped] ]]
19
+
20
+ attr_reader has_one: Array[[ Symbol, Hash[untyped, untyped] ]]
21
+
22
+ attr_reader belongs_to: Array[[ Symbol, Hash[untyped, untyped] ]]
23
+
24
+ attr_reader scopes: Array[[ Symbol, Hash[untyped, untyped] ]]
18
25
 
19
26
  def initialize: () -> void
27
+
28
+ # @rbs string: String
29
+ # @rbs target: Array[Symbol]
20
30
  def parse: (String string, Array[Symbol] target) -> void
31
+
32
+ # @rbs node: RBS::AST::Declarations::t | RBS::AST::Members::t
33
+ # @rbs target: Array[Symbol]
21
34
  def process: (RBS::AST::Declarations::t | RBS::AST::Members::t node, Array[Symbol] target) -> void
35
+
36
+ # @rbs node: AssociationDefinition
22
37
  def process_association_definition: (AssociationDefinition node) -> void
38
+
39
+ # @rbs node: ScopeDefinition
23
40
  def process_scope_definition: (ScopeDefinition node) -> void
41
+
42
+ # @rbs node: untyped
24
43
  def node_to_literal: (untyped node) -> untyped
25
44
  end
26
45
  end