Class: Sketchup::Set
- Inherits:
-
Object
- Object
- Sketchup::Set
Overview
The set class represents a collection of unique objects. This class is useful for keeping track of a group of related entities, kind of like a selection set that stays around for as long as you need it to.
To make a set of your own, create an empty one using Sketchup::Set.new, and then add items to it. Note that in SketchUp 2014 this class was changed from Set to Sketchup::Set in order to avoid conflict with the Ruby Standard Library. The Sketchup::Set class is deprecated and new extensions should make use of Ruby's Set class unless they need backward compatibility.
If you want to ensure backwards compatibility you can use this shim:
Instance Method Summary collapse
-
#clear ⇒ Object
The clear method is used to clear all objects out of the set.
-
#contains?(object) ⇒ Object
The contains? method is an alias for include?.
-
#delete(object) ⇒ Object
The delete object is used to delete or remove an object from the set.
-
#each {|item| ... } ⇒ Object
The each method is used to iterate through all of the objects in the set.
-
#empty? ⇒ Object
The empty? method is used to determine whether the set is empty.
-
#contains?(object) ⇒ Object
The contains? method is an alias for include?.
-
#insert(object) ⇒ Object
The insert method is used to insert an object into the set.
-
#length ⇒ Object
The length method is an alias for size.
-
#size ⇒ Object
The length method is an alias for size.
-
#to_a ⇒ Object
The to_a method is used to get an Array of the entities in your Set.
Instance Method Details
#clear ⇒ Object
The clear method is used to clear all objects out of the set.
#contains?(object) ⇒ Object
The contains? method is an alias for include?. See also Set.include?
#delete(object) ⇒ Object
The delete object is used to delete or remove an object from the set.
#each {|item| ... } ⇒ Object
The each method is used to iterate through all of the objects in the set.
#empty? ⇒ Object
The empty? method is used to determine whether the set is empty.
#contains?(object) ⇒ Object
The contains? method is an alias for include?. See also Set.include?
#insert(object) ⇒ Object
The insert method is used to insert an object into the set.
#length ⇒ Object
The length method is an alias for size. See also Set.size.
#size ⇒ Object
The length method is an alias for size. See also Set.size.
#to_a ⇒ Object
The to_a method is used to get an Array of the entities in your Set.