Method: YARD::CodeObjects::ClassObject#constants

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

#constants(opts = {}) ⇒ Array<ConstantObject>

Returns the list of constants matching the options hash.

Parameters:

  • opts (Hash) (defaults to: {})

    the options hash to match

Options Hash (opts):

  • :inherited (Boolean) — default: true

    whether inherited constant should be included in the list

  • :included (Boolean) — default: true

    whether mixed in constant should be included in the list

Returns:

[View source]

98
99
100
101
# File 'lib/yard/code_objects/class_object.rb', line 98

def constants(opts = {})
  opts = SymbolHash[:inherited => true].update(opts)
  super(opts) + (opts[:inherited] ? inherited_constants : [])
end