Class | YARD::RegistryStore
In: | lib/yard/registry_store.rb
Parent: | Object

The data store for the {Registry}.

@see Registry @see Serializers::YardocSerializer

### Methods

[] []= checksums_path delete destroy get keys load load! load_all load_yardoc new object_types_path objects_path paths_for_type proxy_types_path put root save values values_for_type

### Attributes

checksums | [R] |
file | [R] |
proxy_types | [R] | @deprecated The registry no longer tracks proxy types

### Public Class methods

new()

### Public Instance methods

[](key)

Alias for get

[]=(key, value)

Alias for put

delete(key)

Deletes an object at a given path @param [to_sym] key the key to delete @return [void]

destroy(force = false)

Deletes the .yardoc database on disk

@param [Boolean] force if force is not set to true, the file/directory

      will only be removed if it ends with .yardoc. This helps with
      cases where the directory might have been named incorrectly.

@return [Boolean] true if the .yardoc database was deleted, false

      otherwise.

get(key)

Gets a {CodeObjects::Base} from the store

@param [String, Symbol] key the path name of the object to look for.

      If it is empty or :root, returns the {#root} object.

@return [CodeObjects::Base, nil] a code object or nil if none is found

keys(reload = false)

Gets all path names from the store. Loads the entire database if `reload` is `true`

@param [Boolean] reload if false, does not load the entire database

      before a lookup.

@return [Array<Symbol>] the path names of all the code objects

load(file = nil)

@param [String, nil] file the name of the yardoc db to load @return [Boolean] whether the database was loaded

load!(file = nil)

Loads the .yardoc file and loads all cached objects into memory automatically.

@param [String, nil] file the name of the yardoc db to load @return [Boolean] whether the database was loaded @see load_all @since 0.5.1

load_all()

Loads all cached objects into memory @return [void]

paths_for_type(type, reload = false)

@param [Symbol] type the type to look for @return [Array<String>] a list of object paths with a given

      {CodeObjects::Base#type}

@since 0.8.0

put(key, value)

Associates an object with a path @param [String, Symbol] key the path name (:root or ’’ for root object) @param [CodeObjects::Base] value the object to store @return [CodeObjects::Base] returns `value`

root()

@return [CodeObjects::RootObject] the root object

save(merge = true, file = nil)

Saves the database to disk @param [Boolean] merge if true, merges the data in memory with the

      data on disk, otherwise the data on disk is deleted.

@param [String, nil] file if supplied, the name of the file to save to @return [Boolean] whether the database was saved

values(reload = false)

Gets all code objects from the store. Loads the entire database if `reload` is `true`

@param [Boolean] reload if false, does not load the entire database

      before a lookup.

@return [Array<CodeObjects::Base>] all the code objects

values_for_type(type, reload = false)

@param [Symbol] type the type to look for @return [Array<CodeObjects::Base>] a list of objects with a given

      {CodeObjects::Base#type}

@since 0.8.0

### Protected Instance methods

checksums_path()
load_yardoc()
object_types_path()
objects_path()
proxy_types_path()

@deprecated The registry no longer tracks proxy types

[Validate]