Class: TypeProf::Core::BaseStaticRead

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

Direct Known Subclasses

BaseConstRead, BaseTypeAliasRead

Instance Attribute Summary collapse

Attributes inherited from StaticRead

#followers, #name

Instance Method Summary collapse

Methods inherited from StaticRead

#destroy, #propagate, #resolve

Constructor Details

#initialize(genv, name, cref, strict_const_scope) ⇒ BaseStaticRead

Returns a new instance of BaseStaticRead.



59
60
61
62
63
64
# File 'lib/typeprof/core/env/static_read.rb', line 59

def initialize(genv, name, cref, strict_const_scope)
  super(name)
  @cref = cref
  @search_ancestors = !strict_const_scope
  genv.add_static_eval_queue(:static_read_changed, self)
end

Instance Attribute Details

#crefObject (readonly)

Returns the value of attribute cref.



66
67
68
# File 'lib/typeprof/core/env/static_read.rb', line 66

def cref
  @cref
end

Instance Method Details

#on_scope_updated(genv) ⇒ Object



68
69
70
# File 'lib/typeprof/core/env/static_read.rb', line 68

def on_scope_updated(genv)
  resolve(genv, @cref, @search_ancestors, false)
end