Class: YARD::CodeObjects::ConstantObject

Inherits:
Base
  • Object
show all
Defined in:
lib/yard/code_objects/constant_object.rb

Overview

A ConstantObject represents a Ruby constant (not a module or class). To access the constant's (source code) value, use #value.

Instance Attribute Summary collapse

Constructor Details

This class inherits a constructor from YARD::CodeObjects::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class YARD::CodeObjects::Base

Instance Attribute Details

#base_docstringDocstring (readonly) Originally defined in class Base

The non-localized documentation string associated with the object

Returns:

Since:

  • 0.8.4

#dynamicBoolean Originally defined in class Base

Marks whether or not the method is conditionally defined at runtime

Returns:

  • (Boolean)

    true if the method is conditionally defined at runtime

#filesArray<String> (readonly) Originally defined in class Base

The files the object was defined in. To add a file, use #add_file.

Returns:

See Also:

#groupString Originally defined in class Base

Returns the group this object is associated with

Returns:

  • (String)

    the group this object is associated with

Since:

  • 0.6.0

#namespaceNamespaceObject Also known as: parent Originally defined in class Base

The namespace the object is defined in. If the object is in the top level namespace, this is Registry.root

Returns:

#signatureString Originally defined in class Base

The one line signature representing an object. For a method, this will be of the form “def meth(arguments…)”. This is usually the first source line.

Returns:

  • (String)

    a line of source

#sourceString? Originally defined in class Base

The source code associated with the object

Returns:

  • (String, nil)

    source, if present, or nil

#source_typeSymbol Originally defined in class Base

Language of the source code associated with the object. Defaults to :ruby.

Returns:

  • (Symbol)

    the language type

#valueString

The source code representing the constant's value

Returns:

  • (String)

    the value the constant is set to



7
8
9
# File 'lib/yard/code_objects/constant_object.rb', line 7

def value
  @value
end

#visibilitySymbol Originally defined in class Base

Returns the visibility of an object (:public, :private, :protected)

Returns:

  • (Symbol)

    the visibility of an object (:public, :private, :protected)