class YARD::Handlers::RBS::AttributeHandler
Handles RBS attr_reader, attr_writer, and attr_accessor declarations.
Registers one or two {YARD::CodeObjects::MethodObject} instances (reader and/or writer) with @return / @param tags derived from the RBS type.
Private Instance Methods
Source
# File lib/yard/handlers/rbs/attribute_handler.rb, line 28 def register_reader(name, types, scope) obj = register MethodObject.new(namespace, name, scope) if types && !obj.has_tag?(:return) obj.add_tag YARD::Tags::Tag.new(:return, '', types) end obj end
Source
# File lib/yard/handlers/rbs/attribute_handler.rb, line 36 def register_writer(name, types, scope) obj = register MethodObject.new(namespace, "#{name}=", scope) if types && !obj.has_tag?(:param) obj.add_tag YARD::Tags::Tag.new(:param, '', types, "value") end obj end