Method: YARD::CodeObjects::MethodObject#attr_info

Defined in:
lib/yard/code_objects/method_object.rb

#attr_infoSymbolHash?

Returns the read/writer info for the attribute if it is one

Returns:

  • (SymbolHash)

    if there is information about the attribute

  • (nil)

    if the method is not an attribute

Since:

  • 0.5.3



93
94
95
96
# File 'lib/yard/code_objects/method_object.rb', line 93

def attr_info
  return nil unless namespace.is_a?(NamespaceObject)
  namespace.attributes[scope][name.to_s.gsub(/=$/, '')]
end