Sha256: 66cdb5aa4c8e73b9381243287b57126f172bd94d1b91630881a9966924a8e742
Contents?: true
Size: 1.12 KB
Versions: 25
Compression:
Stored size: 1.12 KB
Contents
# Author:: Eric Crane (mailto:eric.crane@mac.com) # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved. # # The Object Heap. # The collection of objects that are currently in play in # the running engine. # module Gloo module Core class Heap # The context is a reference to an object, usually a container. # The context will be the root by default. attr_reader :context attr_reader :it, :root, :error # # Set up the object heap. # def initialize( engine ) @engine = engine @engine.log.debug 'object heap intialized...' @root = Gloo::Objs::Container.new( @engine ) @root.name = 'root' @context = Pn.root @engine @it = It.new @error = Error.new end # # Unload the given obj--remove it from the heap. # def unload( obj ) can = obj.parent.nil? ? @root : obj.parent return unless can can.remove_child obj end # # Is there one or more errors? # def error? return @error.error_count.positive? end end end end
Version data entries
25 entries across 25 versions & 1 rubygems