Class: TypeProf::Core::ScopedStaticRead

Inherits:
StaticRead
  • Object
show all
Defined in:
lib/typeprof/core/env/static_read.rb

Direct Known Subclasses

ScopedConstRead, ScopedTypeAliasRead

Instance Attribute Summary

Attributes inherited from StaticRead

#followers, #name

Instance Method Summary collapse

Methods inherited from StaticRead

#destroy, #propagate, #resolve

Constructor Details

#initialize(name, cbase, strict_const_scope) ⇒ ScopedStaticRead

Returns a new instance of ScopedStaticRead.



74
75
76
77
78
79
# File 'lib/typeprof/core/env/static_read.rb', line 74

def initialize(name, cbase, strict_const_scope)
  super(name)
  @cbase = cbase
  @cbase.followers << self if @cbase
  @search_ancestors = !strict_const_scope
end

Instance Method Details

#on_cbase_updated(genv) ⇒ Object



81
82
83
84
85
86
87
# File 'lib/typeprof/core/env/static_read.rb', line 81

def on_cbase_updated(genv)
  if @cbase && @cbase.cpath
    resolve(genv, CRef.new(@cbase.cpath, :class, nil, nil), @search_ancestors, true)
  else
    resolution_failed(genv)
  end
end