Class: Primer::Yard::Registry
- Inherits:
 - 
      Object
      
        
- Object
 - Primer::Yard::Registry
 
 
- Extended by:
 - ViewHelper, DocsHelper, ViewComponent::TestHelpers
 
- Defined in:
 - lib/primer/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_default_value, pretty_value, status_module_and_short_name
Constructor Details
#initialize(yard_registry) ⇒ Registry
Returns a new instance of Registry.
      116 117 118  | 
    
      # File 'lib/primer/yard/registry.rb', line 116 def initialize(yard_registry) @yard_registry = yard_registry end  | 
  
Instance Attribute Details
#yard_registry ⇒ Object (readonly)
Returns the value of attribute yard_registry.
      114 115 116  | 
    
      # File 'lib/primer/yard/registry.rb', line 114 def yard_registry @yard_registry end  | 
  
Class Method Details
.make ⇒ Object
      106 107 108 109 110 111  | 
    
      # File 'lib/primer/yard/registry.rb', line 106 def make registry = ::YARD::RegistryStore.new registry.load!(File.(File.join("..", "..", "..", ".yardoc"), __dir__)) new(registry) end  | 
  
Instance Method Details
#find(component) ⇒ Object
      120 121 122 123 124 125 126  | 
    
      # File 'lib/primer/yard/registry.rb', line 120 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  |