Module: Inch::CodeObject::Proxy

Defined in:
lib/inch/code_object/proxy.rb,
lib/inch/code_object/proxy/base.rb,
lib/inch/code_object/proxy/class_object.rb,
lib/inch/code_object/proxy/method_object.rb,
lib/inch/code_object/proxy/module_object.rb,
lib/inch/code_object/proxy/constant_object.rb,
lib/inch/code_object/proxy/namespace_object.rb,
lib/inch/code_object/proxy/method_parameter_object.rb

Overview

CodeObject::Proxy object represent code objects in the analaysed codebase.

Defined Under Namespace

Classes: Base, ClassObject, ConstantObject, MethodObject, MethodParameterObject, ModuleObject, NamespaceObject

Class Method Summary collapse

Class Method Details

.for(code_object) ⇒ CodeObject::Proxy::Base

Returns a Proxy object for the given code_object

Parameters:

  • code_object (YARD::CodeObject)

Returns:



12
13
14
15
16
17
18
19
# File 'lib/inch/code_object/proxy.rb', line 12

def for(code_object)
  @cache ||= {}
  if proxy_object = @cache[cache_key(code_object)]
    proxy_object
  else
    @cache[cache_key(code_object)] = class_for(code_object).new(code_object)
  end
end