Class: YARD::Templates::TemplateOptions
- Inherits:
-
Options
- Object
- Options
- YARD::Templates::TemplateOptions
- 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.
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (String) default_return
The default return type for a method with no return tags.
-
- (Array<String>) embed_mixins
An array of module name wildcards to embed into class documentation as if their methods were defined directly in the class.
-
- (Symbol) format
The template output format.
-
- (OpenStruct) globals
(also: #__globals)
An open struct containing any global state across all generated objects in a template.
-
- (Boolean) hide_void_return
Whether void methods should show “void” in their signature.
-
- (Boolean) highlight
Whether code blocks should be syntax highlighted.
-
- (Symbol) markup
The markup format to use when parsing docstrings.
-
- (Class) markup_provider
The markup provider class for the markup format.
-
- (Boolean) no_highlight
deprecated
Deprecated.
use #highlight instead.
-
- (CodeObjects::Base) object
The main object being generated in the template.
-
- (CodeObjects::Base) owner
The owner of the generated object.
-
- (String) page_title
The title of a given page.
-
- (Boolean) serialize
Whether serialization should be performed.
-
- (Serializers::Base) serializer
The serializer used to generate links and serialize output.
-
- (Symbol) template
The template name used to render output.
-
- (Symbol) type
The template type used to generate output.
-
- (Verifier) verifier
The verifier object.
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
- (String) default_return
Returns the default return type for a method with no return tags
20 |
# File 'lib/yard/templates/template_options.rb', line 20 default_attr :default_return, "Object" |
- (Array<String>) embed_mixins
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.
68 |
# File 'lib/yard/templates/template_options.rb', line 68 default_attr :embed_mixins, lambda { [] } |
- (Symbol) format
Returns the template output format
11 |
# File 'lib/yard/templates/template_options.rb', line 11 default_attr :format, :text |
- (OpenStruct) globals Also known as: __globals
Returns an open struct containing any global state across all generated objects in a template.
33 |
# File 'lib/yard/templates/template_options.rb', line 33 default_attr :globals, lambda { OpenStruct.new } |
- (Boolean) hide_void_return
Returns whether void methods should show “void” in their signature
23 |
# File 'lib/yard/templates/template_options.rb', line 23 default_attr :hide_void_return, false |
- (Boolean) highlight
Returns whether code blocks should be syntax highlighted
26 |
# File 'lib/yard/templates/template_options.rb', line 26 default_attr :highlight, true |
- (Symbol) markup
Returns the markup format to use when parsing docstrings
17 |
# File 'lib/yard/templates/template_options.rb', line 17 default_attr :markup, :rdoc |
- (Class) markup_provider
Returns the markup provider class for the markup format
29 30 31 |
# File 'lib/yard/templates/template_options.rb', line 29 def markup_provider @markup_provider end |
- (Boolean) no_highlight
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 |
- (CodeObjects::Base) object
Returns the main object being generated in the template
37 38 39 |
# File 'lib/yard/templates/template_options.rb', line 37 def object @object end |
- (CodeObjects::Base) owner
Returns the owner of the generated object
40 41 42 |
# File 'lib/yard/templates/template_options.rb', line 40 def owner @owner end |
- (String) page_title
Returns the title of a given page
60 61 62 |
# File 'lib/yard/templates/template_options.rb', line 60 def page_title @page_title end |
- (Boolean) serialize
Returns whether serialization should be performed
46 |
# File 'lib/yard/templates/template_options.rb', line 46 default_attr :serialize, true |
- (Serializers::Base) serializer
Returns the serializer used to generate links and serialize output.
Serialization output only occurs if #serialize is true
.
50 51 52 |
# File 'lib/yard/templates/template_options.rb', line 50 def serializer @serializer end |
- (Symbol) template
Returns the template name used to render output
14 |
# File 'lib/yard/templates/template_options.rb', line 14 default_attr :template, :default |
- (Symbol) type
Returns the template type used to generate output
43 44 45 |
# File 'lib/yard/templates/template_options.rb', line 43 def type @type end |
- (Verifier) verifier
Returns the verifier object
85 86 87 |
# File 'lib/yard/templates/template_options.rb', line 85 def verifier @verifier end |
Instance Method Details
- (Boolean?) embed_mixins_match?(mixin)
74 75 76 77 78 79 80 81 82 |
# File 'lib/yard/templates/template_options.rb', line 74 def (mixin) return nil unless mixin.is_a?(CodeObjects::ModuleObject) return nil if mixin == object # the method is not inherited .any? do || re = /\A#{Regexp.quote().gsub('\*', '.*')}\Z/ matchstr = .include?("::") ? mixin.path : mixin.name re.match(matchstr.to_s) end end |