Class: Yattho::YARD::Registry
- Inherits:
-
Object
- Object
- Yattho::YARD::Registry
- Extended by:
- ViewComponent::TestHelpers, ViewHelper, DocsHelper
- Defined in:
- lib/yattho/yard/registry.rb
Overview
Wrapper around an instance of YARD::Registry that provides easy access to component documentation.
Constant Summary
Constants included from ViewHelper
Instance Attribute Summary collapse
-
#yard_registry ⇒ Object
readonly
Returns the value of attribute yard_registry.
Class Method Summary collapse
Instance Method Summary collapse
- #find(component) ⇒ Object
-
#initialize(yard_registry) ⇒ Registry
constructor
A new instance of Registry.
Methods included from DocsHelper
link_to_accessibility, link_to_component, link_to_heading_practices, link_to_octicons, link_to_system_arguments_docs, link_to_typography_docs, one_of, pretty_value, status_module_and_short_name
Constructor Details
#initialize(yard_registry) ⇒ Registry
Returns a new instance of Registry.
126 127 128 |
# File 'lib/yattho/yard/registry.rb', line 126 def initialize(yard_registry) @yard_registry = yard_registry end |
Instance Attribute Details
#yard_registry ⇒ Object (readonly)
Returns the value of attribute yard_registry.
124 125 126 |
# File 'lib/yattho/yard/registry.rb', line 124 def yard_registry @yard_registry end |
Class Method Details
.make ⇒ Object
116 117 118 119 120 121 |
# File 'lib/yattho/yard/registry.rb', line 116 def make registry = ::YARD::RegistryStore.new registry.load!(".yardoc") new(registry) end |
Instance Method Details
#find(component) ⇒ Object
130 131 132 133 134 135 136 |
# File 'lib/yattho/yard/registry.rb', line 130 def find(component) return entries[component] if entries.include?(component) return unless (docs = yard_registry.get(component.name)) entries[component] = RegistryEntry.new(component, docs) end |