Sha256: cab1001c31c473f185e9b8f93ad8146ad3f1b4c12823154ea0c3ea213eac9ed9
Contents?: true
Size: 704 Bytes
Versions: 23
Compression:
Stored size: 704 Bytes
Contents
# Author:: Eric Crane (mailto:eric.crane@mac.com) # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved. # # Utility used to find objects. # module GlooLang module Core class ObjFinder # # Find all objects in the given container that have # the given name. # If the container isn't provided, root will be used. # def self.by_name( engine, name, container = nil ) container = engine.heap.root if container.nil? arr = [] container.children.each do |o| arr << o if o.name == name arr += by_name( engine, name, o ) if o.child_count.positive? end return arr end end end end
Version data entries
23 entries across 23 versions & 1 rubygems