Class: YARD::Templates::TemplateOptions

Inherits:
Options
  • Object
show all
Defined in:
lib/yard/templates/template_options.rb

Overview

An Options class containing default options for base template rendering. For options specific to generation of HTML output, see CLI::YardocOptions.

See Also:

Direct Known Subclasses

CLI::GraphOptions, CLI::YardocOptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

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

Instance Attribute Details

#default_returnString


20
# File 'lib/yard/templates/template_options.rb', line 20

default_attr :default_return, "Object"

#embed_mixinsArray<String>

Returns an array of module name wildcards to embed into class documentation as if their methods were defined directly in the class. Useful for modules like ClassMethods. If the name contains '::', the module is matched against the full mixin path, otherwise only the module name is used.

Examples:

A list of mixin path names (including wildcards)

opts.embed_mixins #=> ['ClassMethods', '*Helper', 'YARD::*']

71
# File 'lib/yard/templates/template_options.rb', line 71

default_attr :embed_mixins, lambda { [] }

#formatSymbol


11
# File 'lib/yard/templates/template_options.rb', line 11

default_attr :format, :text

#globalsOpenStruct Also known as: __globals


33
# File 'lib/yard/templates/template_options.rb', line 33

default_attr :globals, lambda { OpenStruct.new }

#hide_void_returnBoolean


23
# File 'lib/yard/templates/template_options.rb', line 23

default_attr :hide_void_return, false

#highlightBoolean


26
# File 'lib/yard/templates/template_options.rb', line 26

default_attr :highlight, true

#indexBoolean


63
64
65
# File 'lib/yard/templates/template_options.rb', line 63

def index
  @index
end

#markupSymbol


17
# File 'lib/yard/templates/template_options.rb', line 17

default_attr :markup, :rdoc

#markup_providerClass


29
30
31
# File 'lib/yard/templates/template_options.rb', line 29

def markup_provider
  @markup_provider
end

#no_highlightBoolean

Deprecated.

use #highlight instead.

Returns whether highlighting should be ignored


54
55
56
# File 'lib/yard/templates/template_options.rb', line 54

def no_highlight
  @no_highlight
end

#objectCodeObjects::Base


37
38
39
# File 'lib/yard/templates/template_options.rb', line 37

def object
  @object
end

#ownerCodeObjects::Base


40
41
42
# File 'lib/yard/templates/template_options.rb', line 40

def owner
  @owner
end

#page_titleString


60
61
62
# File 'lib/yard/templates/template_options.rb', line 60

def page_title
  @page_title
end

#serializeBoolean


46
# File 'lib/yard/templates/template_options.rb', line 46

default_attr :serialize, true

#serializerSerializers::Base


50
51
52
# File 'lib/yard/templates/template_options.rb', line 50

def serializer
  @serializer
end

#templateSymbol


14
# File 'lib/yard/templates/template_options.rb', line 14

default_attr :template, :default

#typeSymbol


43
44
45
# File 'lib/yard/templates/template_options.rb', line 43

def type
  @type
end

#verifierVerifier


88
89
90
# File 'lib/yard/templates/template_options.rb', line 88

def verifier
  @verifier
end

Instance Method Details

#embed_mixins_match?(mixin) ⇒ Boolean?


77
78
79
80
81
82
83
84
85
# File 'lib/yard/templates/template_options.rb', line 77

def embed_mixins_match?(mixin)
  return true if mixin == object # the method is not inherited
  return nil unless mixin.is_a?(CodeObjects::ModuleObject)
  embed_mixins.any? do |embed_mixin|
    re = /\A#{Regexp.quote(embed_mixin).gsub('\*', '.*')}\Z/
    matchstr = embed_mixin.include?("::") ? mixin.path : mixin.name
    re.match(matchstr.to_s)
  end
end