Sha256: 941139a9fe3286d1cc2c12c9c0c8477794d23e1e041f92c58258bd1b0e89ac01

Contents?: true

Size: 685 Bytes

Versions: 17

Compression:

Stored size: 685 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 Gloo
  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( 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( name, o ) if o.child_count.positive?
        end

        return arr
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
gloo-0.8.0 lib/gloo/core/obj_finder.rb
gloo-0.7.7 lib/gloo/core/obj_finder.rb
gloo-0.7.6 lib/gloo/core/obj_finder.rb
gloo-0.7.5 lib/gloo/core/obj_finder.rb
gloo-0.7.4 lib/gloo/core/obj_finder.rb
gloo-0.7.3 lib/gloo/core/obj_finder.rb
gloo-0.7.2 lib/gloo/core/obj_finder.rb
gloo-0.7.1 lib/gloo/core/obj_finder.rb
gloo-0.7.0 lib/gloo/core/obj_finder.rb
gloo-0.6.1 lib/gloo/core/obj_finder.rb
gloo-0.6.0 lib/gloo/core/obj_finder.rb
gloo-0.5.4 lib/gloo/core/obj_finder.rb
gloo-0.5.3 lib/gloo/core/obj_finder.rb
gloo-0.5.2 lib/gloo/core/obj_finder.rb
gloo-0.5.1 lib/gloo/core/obj_finder.rb
gloo-0.5.0 lib/gloo/core/obj_finder.rb
gloo-0.4.0 lib/gloo/core/obj_finder.rb