Class: Sketchup::AttributeDictionary
- Includes:
- Enumerable
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb
Overview
The AttributeDictionary class allows you to attach arbitrary collections of attributes to a SketchUp entity. The attributes are defined by key/value pairs where the keys are strings. An Entity or Model object can have any number of AttributeDictionary objects (see the AttributeDictionaries class).
The Entity class is a popular parent class in SketchUp, meaning you can attach attribute dictionaries to almost anything, from geometric items like edges and faces and components to more conceptual things like pages or materials.
Instance Method Summary collapse
-
#[](key) ⇒ Object?
The [] method is used to retrieve the attribute with a given key.
-
#[]=(key, value) ⇒ Object?
The set value ([]=) method is used to set the value of an attribute with a given key.
-
#count ⇒ Integer
The count method is inherited from the Enumerable mix-in module.
-
#delete_key(key) ⇒ Object?
The delete_key method is used to delete an attribute with a given key.
-
#each {|key, value| ... } ⇒ Object
The #each method iterate through all of the attributes.
-
#each_key {|key| ... } ⇒ nil
The #each_key method is used to iterate through all of the attribute keys.
-
#each_pair {|key, value| ... } ⇒ Object
The #each_pair method is an alias for #each.
-
#keys ⇒ Array<String>
The keys method is used to retrieve an array with all of the attribute keys.
-
#length ⇒ Integer
The #length method is used to retrieve the size (number of elements) of an attribute dictionary.
-
#name ⇒ String
The name method is used to retrieve the name of an attribute dictionary.
- #size ⇒ Integer
-
#values ⇒ Array<Object>
The values method is used to retrieve an array with all of the attribute values.
Methods inherited from Entity
#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #remove_observer, #set_attribute, #to_s, #typename, #valid?
Instance Method Details
#[](key) ⇒ Object?
The [] method is used to retrieve the attribute with a given key.
41 42 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 41 def [](key) end |
#[]=(key, value) ⇒ Object?
The set value ([]=) method is used to set the value of an attribute with a given key.
Creates a new attribute for the given key if needed.
69 70 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 69 def []=(key, value) end |
#count ⇒ Integer
The count method is inherited from the Enumerable mix-in module.
83 84 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 83 def count end |
#delete_key(key) ⇒ Object?
The delete_key method is used to delete an attribute with a given key.
105 106 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 105 def delete_key(key) end |
#each {|key, value| ... } ⇒ Object
The #each method iterate through all of the attributes.
134 135 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 134 def each end |
#each_key {|key| ... } ⇒ nil
The #each_key method is used to iterate through all of the attribute keys.
156 157 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 156 def each_key end |
#each_pair {|key, value| ... } ⇒ Object
The #each_pair method is an alias for #each.
185 186 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 185 def each_pair end |
#keys ⇒ Array<String>
The keys method is used to retrieve an array with all of the attribute keys.
205 206 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 205 def keys end |
#length ⇒ Integer
The #length method is used to retrieve the size (number of elements) of an attribute dictionary.
222 223 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 222 def length end |
#name ⇒ String
The name method is used to retrieve the name of an attribute dictionary.
241 242 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 241 def name end |
#size ⇒ Integer
257 258 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 257 def size end |
#values ⇒ Array<Object>
The values method is used to retrieve an array with all of the attribute values.
278 279 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb', line 278 def values end |