Module: TypeProf::Core::ConstRead
- Included in:
- BaseConstRead, ScopedConstRead
- Defined in:
- lib/typeprof/core/env/static_read.rb
Instance Attribute Summary collapse
-
#cdef ⇒ Object
readonly
Returns the value of attribute cdef.
-
#cpath ⇒ Object
readonly
Returns the value of attribute cpath.
Instance Method Summary collapse
- #check_module(genv, mod) ⇒ Object
- #resolution_failed(genv) ⇒ Object
- #update_module(genv, cpath, cdef) ⇒ Object
Instance Attribute Details
#cdef ⇒ Object (readonly)
Returns the value of attribute cdef.
113 114 115 |
# File 'lib/typeprof/core/env/static_read.rb', line 113 def cdef @cdef end |
#cpath ⇒ Object (readonly)
Returns the value of attribute cpath.
113 114 115 |
# File 'lib/typeprof/core/env/static_read.rb', line 113 def cpath @cpath end |
Instance Method Details
#check_module(genv, mod) ⇒ Object
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/typeprof/core/env/static_read.rb', line 90 def check_module(genv, mod) cdef = mod.consts[@name] if cdef && cdef.exist? inner_mod = genv.resolve_cpath(mod.cpath + [@name]) # TODO cpath = inner_mod.exist? ? inner_mod.cpath : nil update_module(genv, cpath, cdef) return true end return false end |
#resolution_failed(genv) ⇒ Object
101 102 103 |
# File 'lib/typeprof/core/env/static_read.rb', line 101 def resolution_failed(genv) update_module(genv, nil, nil) end |
#update_module(genv, cpath, cdef) ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/typeprof/core/env/static_read.rb', line 105 def update_module(genv, cpath, cdef) if cpath != @cpath || cdef != @cdef @cpath = cpath @cdef = cdef propagate(genv) end end |