Module: Inch::CodeObject::Provider

Defined in:
lib/inch/code_object/provider.rb

Overview

Provider modules “provide” a Codebase object with code objects. They are the intermediary between the raw representation that tools like YARD deliver and the “interface” that Inch expects.

YARD Example:

YARD’s SourceParser returns ::YARD::CodeObject objects, which are cast to Provider::YARD::Object::Base objects that can ensure naming conventions et al. follow certain rules. These objects are then again converted into CodeObject::Proxy objects that form the codebase:

             ::YARD::CodeObject
                    |
::Inch::CodeObject::Provider::YARD::Object::Base
                    |
                  (Hash)
                    |
        ::Inch::CodeObject::Proxy

Class Method Summary collapse

Class Method Details

.parse(dir, config = Inch::Config.codebase) ⇒ #objects

Parses a codebase to provide objects

Parameters:

  • dir (String)

    the directory to parse

  • config (Inch::Config::Codebase) (defaults to: Inch::Config.codebase)

Returns:

  • (#objects)


29
30
31
32
33
# File 'lib/inch/code_object/provider.rb', line 29

def self.parse(dir, config = Inch::Config.codebase)
  Config.namespace(config.language, :Provider)
    .const_get(config.object_provider)
    .parse(dir, config)
end