class YARD::Handlers::Ruby::AttributeHandler
Handles attr_*
statements in modules/classes
Protected Instance Methods
validated_attribute_names(params)
click to toggle source
Strips out any non-essential arguments from the attr statement.
@param [Array<Parser::Ruby::AstNode>] params a list of the parameters
in the attr call.
@return [Array<String>] the validated attribute names @raise [Parser::UndocumentableError] if the arguments are not valid.
# File lib/yard/handlers/ruby/attribute_handler.rb, line 75 def validated_attribute_names(params) params.map do |obj| case obj.type when :symbol_literal obj.jump(:ident, :op, :kw, :const).source when :string_literal obj.jump(:string_content).source else raise YARD::Parser::UndocumentableError, obj.source end end end