Module: YARD::Templates::Helpers::BaseHelper

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

Instance Method Summary collapse

Instance Method Details

#format_object_title(object) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/yard/templates/helpers/base_helper.rb', line 3

def format_object_title(object)
  if object.is_a?(YARD::CodeObjects::Lucid::FeatureTags)
    "Tags"
  elsif object.is_a?(YARD::CodeObjects::Lucid::StepTransformersObject)
    "Steps and Transforms"
  elsif object.is_a?(YARD::CodeObjects::Lucid::NamespaceObject)
    "#{format_object_type(object)}#{object.value ? ": #{object.value}" : ''}"
  elsif object.is_a?(YARD::CodeObjects::Lucid::FeatureDirectory)
    "Feature Directory: #{object.name}"
  else
    case object
    when YARD::CodeObjects::RootObject
      "Top Level Namespace"
    else
      format_object_type(object) + ": " + object.path
    end
  end
end