Module: Inch::Language::Nodejs::Provider::JSDoc::Object

Defined in:
lib/inch/language/nodejs/provider/jsdoc/object.rb,
lib/inch/language/nodejs/provider/jsdoc/object/base.rb,
lib/inch/language/nodejs/provider/jsdoc/object/class_object.rb,
lib/inch/language/nodejs/provider/jsdoc/object/module_object.rb,
lib/inch/language/nodejs/provider/jsdoc/object/member_object.rb,
lib/inch/language/nodejs/provider/jsdoc/object/function_object.rb,
lib/inch/language/nodejs/provider/jsdoc/object/function_parameter_object.rb

Overview

CodeObject::Provider::JSDoc::Object object represent code objects.

Defined Under Namespace

Classes: Base, ClassObject, FunctionObject, FunctionParameterObject, MemberObject, ModuleObject

Class Method Summary collapse

Class Method Details

.clear_cacheObject


16
17
18
# File 'lib/inch/language/nodejs/provider/jsdoc/object.rb', line 16

def clear_cache
  @cache = {}
end

.for(jsdoc_object) ⇒ Provider::JSDoc::Object

Returns a Proxy object for the given jsdoc_object

Parameters:

  • jsdoc_object (Hash)

Returns:


24
25
26
27
28
29
30
31
32
# File 'lib/inch/language/nodejs/provider/jsdoc/object.rb', line 24

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