Module: YARD::Templates::Helpers::FilterHelper

Defined in:
lib/yard/templates/helpers/filter_helper.rb

Overview

Helpers for various object types

Instance Method Summary collapse

Instance Method Details

#is_class?(object) ⇒ Boolean

Returns whether an object is a class.

Returns:

  • (Boolean)

    whether an object is a class



17
18
19
# File 'lib/yard/templates/helpers/filter_helper.rb', line 17

def is_class?(object)
  object.is_a?(CodeObjects::ClassObject)
end

#is_method?(object) ⇒ Boolean

Returns whether an object is a method.

Returns:

  • (Boolean)

    whether an object is a method



7
8
9
# File 'lib/yard/templates/helpers/filter_helper.rb', line 7

def is_method?(object)
  object.type == :method
end

#is_module?(object) ⇒ Boolean

Returns whether an object is a module.

Returns:

  • (Boolean)

    whether an object is a module



22
23
24
# File 'lib/yard/templates/helpers/filter_helper.rb', line 22

def is_module?(object)
  object.is_a?(CodeObjects::ModuleObject)
end

#is_namespace?(object) ⇒ Boolean

Returns whether an object is a namespace.

Returns:

  • (Boolean)

    whether an object is a namespace



12
13
14
# File 'lib/yard/templates/helpers/filter_helper.rb', line 12

def is_namespace?(object)
  object.is_a?(CodeObjects::NamespaceObject)
end