Class: Sketchup::AttributeDictionary
- Includes:
- Enumerable
- Defined in:
- lib/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.
The Entity class is a popular parent class in SketchUp, meaning you can attach AttributeDictionaries 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
Get attribute value.
-
#[]=(key, value) ⇒ Object
Set attribute value.
-
#delete_key(key) ⇒ Object
Delete an attribute with a given key.
-
#each {|key, value| ... } ⇒ nil
(also: #each_pair)
Iterate through all of the attribute keys and values.
-
#each_key {|key| ... } ⇒ nil
Iterate through all of the attribute keys.
-
#keys ⇒ Array
Get an array with all of the attribute keys.
-
#length ⇒ Fixnum
(also: #size)
Get the number of attributes in the attribute dictionary.
-
#name ⇒ String
Get the name of an attribute dictionary.
-
#values ⇒ Array
Get an array with all of the attribute values.
Methods inherited from Entity
#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #model, #parent, #remove_observer, #set_attribute, #to_s, #typename, #valid?
Instance Method Details
#[](key) ⇒ Object
Get attribute value.
35 36 |
# File 'lib/attributedictionary.rb', line 35 def [](key) end |
#[]=(key, value) ⇒ Object
Set attribute value.
55 56 |
# File 'lib/attributedictionary.rb', line 55 def []=(key, value) end |
#delete_key(key) ⇒ Object
Delete an attribute with a given key.
75 76 |
# File 'lib/attributedictionary.rb', line 75 def delete_key(key) end |
#each {|key, value| ... } ⇒ nil Also known as: each_pair
Iterate through all of the attribute keys and values.
97 98 |
# File 'lib/attributedictionary.rb', line 97 def each end |
#each_key {|key| ... } ⇒ nil
Iterate through all of the attribute keys.
116 117 |
# File 'lib/attributedictionary.rb', line 116 def each_key end |
#keys ⇒ Array
Get an array with all of the attribute keys.
124 125 |
# File 'lib/attributedictionary.rb', line 124 def keys end |
#length ⇒ Fixnum Also known as: size
Get the number of attributes in the attribute dictionary.
136 137 |
# File 'lib/attributedictionary.rb', line 136 def length end |
#name ⇒ String
Get the name of an attribute dictionary.
154 155 |
# File 'lib/attributedictionary.rb', line 154 def name end |
#values ⇒ Array
Get an array with all of the attribute values.
171 172 |
# File 'lib/attributedictionary.rb', line 171 def values end |