lib/rbs/definition.rb in rbs-0.9.1 vs lib/rbs/definition.rb in rbs-0.10.0
- old
+ new
@@ -48,15 +48,17 @@
end
attr_reader :super_method
attr_reader :defs
attr_reader :accessibility
+ attr_reader :extra_annotations
- def initialize(super_method:, defs:, accessibility:)
+ def initialize(super_method:, defs:, accessibility:, annotations: [])
@super_method = super_method
@defs = defs
@accessibility = accessibility
+ @extra_annotations = annotations
end
def defined_in
@defined_in ||= defs.last.defined_in
end
@@ -72,10 +74,10 @@
def comments
@comments ||= defs.map(&:comment).compact
end
def annotations
- @annotations ||= defs.flat_map(&:annotations)
+ @annotations ||= @extra_annotations + defs.flat_map(&:annotations)
end
# @deprecated
def attributes
[]