Skip to content

Commit c3f79e9

Browse files
committed
CodeObject method interface has been changed
RDoc::{Alias,Attr,AnyMethod,MethodAttr}.new
1 parent d094e76 commit c3f79e9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/rdoc_plugin/parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def parse_method_decl(decl:, context:, outer_name: nil)
8686
end
8787

8888
def parse_method_alias_decl(decl:, context:, outer_name: nil)
89-
alias_def = RDoc::Alias.new(nil, decl.old_name.to_s, decl.new_name.to_s, nil, decl.kind == :singleton)
89+
alias_def = RDoc::Alias.new(nil, decl.old_name.to_s, decl.new_name.to_s, nil, singleton: decl.kind == :singleton)
9090
alias_def.comment = construct_comment(context: context, comment: comment_string(decl)) if decl.comment
9191
context.add_alias(alias_def)
9292
end
@@ -100,7 +100,7 @@ def parse_attr_decl(decl:, context:, outer_name: nil)
100100
when ::RBS::AST::Members::AttrAccessor
101101
'RW'
102102
end
103-
attribute = RDoc::Attr.new(nil, decl.name.to_s, rw, nil, decl.kind == :singleton)
103+
attribute = RDoc::Attr.new(nil, decl.name.to_s, rw, nil, singleton: decl.kind == :singleton)
104104
attribute.visibility = decl.visibility
105105
attribute.comment = construct_comment(context: context, comment: comment_string(decl)) if decl.comment
106106
context.add_attribute(attribute)

stdlib/rdoc/0/rdoc.rbs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ module RDoc
190190
#
191191
# Usually this is called by super from a subclass.
192192
#
193-
def initialize: (String text, String name) -> void
193+
def initialize: (String text, String name, ?singleton: bool) -> void
194194

195195
# <!--
196196
# rdoc-file=lib/rdoc/method_attr.rb
@@ -267,7 +267,7 @@ module RDoc
267267
# -->
268268
# Creates a new AnyMethod with a token stream `text` and `name`
269269
#
270-
def initialize: (String? text, String name) -> void
270+
def initialize: (String? text, String name, ?singleton: bool) -> void
271271
end
272272

273273
# <!-- rdoc-file=lib/rdoc/attr.rb -->
@@ -286,7 +286,7 @@ module RDoc
286286
# Creates a new Attr with body `text`, `name`, read/write status `rw` and
287287
# `comment`. `singleton` marks this as a class attribute.
288288
#
289-
def initialize: (String? text, String name, String rw, RDoc::Comment? comment, ?bool `singleton`) -> void
289+
def initialize: (String? text, String name, String rw, RDoc::Comment? comment, ?singleton: bool) -> void
290290
end
291291

292292
# <!-- rdoc-file=lib/rdoc/constant.rb -->
@@ -372,14 +372,16 @@ module RDoc
372372
#
373373
attr_accessor old_name: String
374374

375+
attr_reader singleton: bool
376+
375377
# <!--
376378
# rdoc-file=lib/rdoc/alias.rb
377379
# - new(text, old_name, new_name, comment, singleton = false)
378380
# -->
379381
# Creates a new Alias with a token stream of `text` that aliases `old_name` to
380382
# `new_name`, has `comment` and is a `singleton` context.
381383
#
382-
def initialize: (String? text, String name, String old_name, RDoc::Comment? comment, ?bool `singleton`) -> void
384+
def initialize: (String? text, String name, String old_name, RDoc::Comment? comment, ?singleton: bool) -> void
383385
end
384386

385387
# <!-- rdoc-file=lib/rdoc/stats.rb -->

0 commit comments

Comments
 (0)