class TypeProf::Core::Box
Attributes
Public Class Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/graph/box.rb, line 4 def initialize(node) @node = node @changes = ChangeSet.new(node, self) @destroyed = false $box_counts[Box] += 1 $box_counts[self.class] += 1 end
Public Instance Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/graph/box.rb, line 16 def destroy(genv) $box_counts[self.class] -= 1 $box_counts[Box] -= 1 @destroyed = true @changes.reinstall(genv) # rollback all changes end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/graph/box.rb, line 28 def on_type_added(genv, src_tyvar, added_types) genv.add_run(self) end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/graph/box.rb, line 32 def on_type_removed(genv, src_tyvar, removed_types) genv.add_run(self) end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/graph/box.rb, line 23 def reuse(new_node) @node = new_node @changes.reuse(new_node) end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/graph/box.rb, line 36 def run(genv) return if @destroyed run0(genv, @changes) @changes.reinstall(genv) end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/graph/box.rb, line 42 def run0(genv, changes) raise NotImplementedError end