Sha256: 96649e1a0e7702c44d9c27743e0ca8549ceec376c214680c4d765fa3e2df19e2

Contents?: true

Size: 700 Bytes

Versions: 25

Compression:

Stored size: 700 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( 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

25 entries across 25 versions & 1 rubygems

Version Path
gloo-3.8.0 lib/gloo/core/obj_finder.rb
gloo-3.7.0 lib/gloo/core/obj_finder.rb
gloo-3.6.2 lib/gloo/core/obj_finder.rb
gloo-3.6.1 lib/gloo/core/obj_finder.rb
gloo-3.6.0 lib/gloo/core/obj_finder.rb
gloo-3.5.0 lib/gloo/core/obj_finder.rb
gloo-3.4.1 lib/gloo/core/obj_finder.rb
gloo-3.4.0 lib/gloo/core/obj_finder.rb
gloo-3.3.0 lib/gloo/core/obj_finder.rb
gloo-3.2.0 lib/gloo/core/obj_finder.rb
gloo-3.1.1 lib/gloo/core/obj_finder.rb
gloo-3.1.0 lib/gloo/core/obj_finder.rb
gloo-3.0.1 lib/gloo/core/obj_finder.rb
gloo-3.0.0 lib/gloo/core/obj_finder.rb
gloo-2.5.0 lib/gloo/core/obj_finder.rb
gloo-2.4.3 lib/gloo/core/obj_finder.rb
gloo-2.4.2 lib/gloo/core/obj_finder.rb
gloo-2.4.1 lib/gloo/core/obj_finder.rb
gloo-2.4.0 lib/gloo/core/obj_finder.rb
gloo-2.3.1 lib/gloo/core/obj_finder.rb