Module: Inch::Language::Elixir::Provider::Reader::Object

Defined in:
lib/inch/language/elixir/provider/reader/object.rb,
lib/inch/language/elixir/provider/reader/object/base.rb,
lib/inch/language/elixir/provider/reader/object/type_object.rb,
lib/inch/language/elixir/provider/reader/object/module_object.rb,
lib/inch/language/elixir/provider/reader/object/function_object.rb,
lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb

Overview

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

Defined Under Namespace

Classes: Base, FunctionObject, FunctionParameterObject, ModuleObject, TypeObject

Class Method Summary collapse

Class Method Details

.clear_cacheObject


15
16
17
# File 'lib/inch/language/elixir/provider/reader/object.rb', line 15

def clear_cache
  @cache = {}
end

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

Returns a Proxy object for the given json_object

Parameters:

  • json_object (Hash)

Returns:

  • (Provider::JSDoc::Object)

23
24
25
26
27
28
29
30
31
# File 'lib/inch/language/elixir/provider/reader/object.rb', line 23

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