sketchup-api-stubs 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/SketchUp/{array.rb → Array.rb} +0 -0
  3. data/SketchUp/{geom.rb → Geom.rb} +0 -0
  4. data/SketchUp/Geom/LatLong.rb +8 -20
  5. data/SketchUp/Geom/Point3d.rb +2 -2
  6. data/SketchUp/Geom/Vector3d.rb +31 -26
  7. data/SketchUp/{languagehandler.rb → LanguageHandler.rb} +0 -0
  8. data/SketchUp/{length.rb → Length.rb} +0 -0
  9. data/SketchUp/{numeric.rb → Numeric.rb} +0 -0
  10. data/SketchUp/Sketchup/AttributeDictionaries.rb +8 -11
  11. data/SketchUp/Sketchup/AttributeDictionary.rb +39 -38
  12. data/SketchUp/Sketchup/Classifications.rb +9 -5
  13. data/SketchUp/Sketchup/DefinitionList.rb +9 -12
  14. data/SketchUp/Sketchup/Entities.rb +16 -36
  15. data/SketchUp/Sketchup/ExtensionsManager.rb +10 -14
  16. data/SketchUp/Sketchup/InstancePath.rb +6 -3
  17. data/SketchUp/Sketchup/Layers.rb +20 -24
  18. data/SketchUp/Sketchup/Licensing.rb +14 -13
  19. data/SketchUp/Sketchup/Materials.rb +10 -8
  20. data/SketchUp/Sketchup/Menu.rb +13 -15
  21. data/SketchUp/Sketchup/OptionsManager.rb +11 -14
  22. data/SketchUp/Sketchup/OptionsProvider.rb +55 -54
  23. data/SketchUp/Sketchup/Pages.rb +9 -9
  24. data/SketchUp/Sketchup/RenderingOptions.rb +27 -15
  25. data/SketchUp/Sketchup/Selection.rb +57 -89
  26. data/SketchUp/Sketchup/Set.rb +69 -104
  27. data/SketchUp/Sketchup/ShadowInfo.rb +26 -26
  28. data/SketchUp/Sketchup/Styles.rb +8 -9
  29. data/SketchUp/{sketchupextension.rb → SketchupExtension.rb} +0 -0
  30. data/SketchUp/{string.rb → String.rb} +0 -0
  31. data/SketchUp/UI/Toolbar.rb +8 -8
  32. data/SketchUp/_top_level.rb +11 -11
  33. data/SketchUp/ui.rb +4 -5
  34. metadata +10 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e767a530efec610dbe924a90a2132297bf68bef
4
- data.tar.gz: 9124efa94bc161ab407921398a40f6f05b22c6f5
3
+ metadata.gz: 26637fb494dcc7f44b4445e237bbf28a252bfdf5
4
+ data.tar.gz: a67eeba59e499c9235d43efbcc465fe02e50f956
5
5
  SHA512:
6
- metadata.gz: 63264aa870bb4c805b8bbf8eb3feff1cfa7388ec511e858694c0948d8910243a278a60818de5430367e1121ec8b67c8e41c4968815c7da37ab557ba559230c88
7
- data.tar.gz: 45e6aca141709127131dd39233f92dae97c767d9315b9a5ebe6c9d928684b6d9bb18e2d15e9e9a49c931f87429b40d7fb79e81cc27202fdd968d68f7a3cd0b36
6
+ metadata.gz: 0ec84ecbee17a6d05970cb9f6a7f322a58ab6109fedd91cf6d2cdd68bd01f4133dd795f0ae1043add96f83022edbcd58f7ad487987a07d8df5d94e3bcb6d9b70
7
+ data.tar.gz: 878cd1af89b83c621221cee370737ff18ca5a3c24240434293f421fb65164bc43fdb42d2c788a47f43a4b9274ac47c189e1350fa672ab7022095a3450a2af9cd
File without changes
File without changes
@@ -66,37 +66,25 @@ class Geom::LatLong
66
66
  def longitude
67
67
  end
68
68
 
69
- # The to_a method converts a LatLong object to an array of two values.
69
+ # The {#to_a} method converts a LatLong object to an array of two values.
70
70
  #
71
71
  # @example
72
- # ll = [40.01700, 105.28300]
73
- # latlong = Geom::LatLong.new(ll)
74
- # a = latlong.to_a
75
- # if (a)
76
- # UI.messagebox a
77
- # else
78
- # UI.messagebox "Failure"
79
- # end
72
+ # latlong = Geom::LatLong.new([40.01700, 105.28300])
73
+ # array = latlong.to_a
80
74
  #
81
- # @return array - an array of two values: latitude and longitude
75
+ # @return [Array(Float, Float)] an array of latitude and longitude
82
76
  #
83
77
  # @version SketchUp 6.0
84
78
  def to_a
85
79
  end
86
80
 
87
- # The to_a method converts a LatLong object to a string.
81
+ # The {#to_s} method converts a LatLong object to a {String}.
88
82
  #
89
83
  # @example
90
- # ll = [40.01700, 105.28300]
91
- # latlong = Geom::LatLong.new(ll)
92
- # s = latlong.to_s
93
- # if (s)
94
- # UI.messagebox s
95
- # else
96
- # UI.messagebox "Failure"
97
- # end
84
+ # latlong = Geom::LatLong.new([40.01700, 105.28300])
85
+ # string = latlong.to_s
98
86
  #
99
- # @return string - a string representation of a LatLong object
87
+ # @return [String]
100
88
  #
101
89
  # @version SketchUp 6.0
102
90
  def to_s
@@ -329,8 +329,8 @@ class Geom::Point3d
329
329
  #
330
330
  # @example
331
331
  # point1 = Geom::Point3d.new(10,10,10)
332
- # vector = Geom::Vector3d.new(0,0,1)
333
- # point2 = point1.offset! vector
332
+ # vector = Geom::Vector3d.new(0, 0, 1)
333
+ # point2 = point1.offset(vector)
334
334
  #
335
335
  # @param vector
336
336
  # A Vector3d object to offset the point by.
@@ -49,42 +49,44 @@ class Geom::Vector3d
49
49
 
50
50
  # Instance Methods
51
51
 
52
- # The dot method is used to compute the dot product between two vectors.
52
+ # The {#%} method is used to compute the dot product between two vectors.
53
+ #
54
+ # This is an alias of the {#dot} method.
53
55
  #
54
56
  # @example
55
- # vector = Geom::Vector3d.new 0,0,1
56
- # vector2 = Geom::Vector3d.new 0,1,0
57
- # d = vector.dot vector2
57
+ # vector1 = Geom::Vector3d.new(0, 0, 1)
58
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
59
+ # dot = vector1 % vector2
58
60
  #
59
- # @param vector2
60
- # A Vector3d object.
61
+ # @param [Geom::Vector] vector
62
+ #
63
+ # @return [Float]
61
64
  #
62
- # @return d - the dot product of vector1 and vector2
65
+ # @see #dot
63
66
  #
64
67
  # @version SketchUp 6.0
65
- def %(vector2)
68
+ def %(vector)
66
69
  end
67
70
 
68
- # The cross method is used to compute the cross product between two vectors.
71
+ # The {#*} method is used to compute the cross product between two vectors.
69
72
  #
70
73
  # The cross product, also called the vector product, is an operation on two
71
74
  # vectors. The cross product of two vectors produces a third vector which is
72
75
  # perpendicular to the plane in which the first two lie.
73
76
  #
74
- # @example
75
- # vector1 = Geom::Vector3d.new(1,0,0)
76
- # vector2 = Geom::Vector3d.new(0,1,0)
77
- # vector3 = vector1 * vector2
77
+ # This is an alias of the {#cross} method.
78
78
  #
79
79
  # @example
80
- # vector = Geom::Vector3d.new(1,0,0)
81
- # vector2 = Geom::Vector3d.new(0,1,0)
82
- # vector3 = vector.cross(vector2)
80
+ # vector1 = Geom::Vector3d.new 1,0,0
81
+ # vector2 = Geom::Vector3d.new 0,1,0
82
+ # vector3 = vector1 * vector2
83
83
  #
84
84
  # @param vector
85
85
  # A Vector3d object.
86
86
  #
87
- # @return vector - the cross of vector1 and vector2
87
+ # @return vector - a Vector3d object if successful
88
+ #
89
+ # @see #cross
88
90
  #
89
91
  # @version SketchUp 6.0
90
92
  def *(vector)
@@ -251,7 +253,7 @@ class Geom::Vector3d
251
253
  def clone
252
254
  end
253
255
 
254
- # The cross method is used to compute the cross product between two vectors.
256
+ # The {#cross} method is used to compute the cross product between two vectors.
255
257
  #
256
258
  # The cross product, also called the vector product, is an operation on two
257
259
  # vectors. The cross product of two vectors produces a third vector which is
@@ -272,24 +274,27 @@ class Geom::Vector3d
272
274
  #
273
275
  # @return vector - the cross of vector1 and vector2
274
276
  #
277
+ # @see #*
278
+ #
275
279
  # @version SketchUp 6.0
276
280
  def cross(vector)
277
281
  end
278
282
 
279
- # The dot method is used to compute the dot product between two vectors.
283
+ # The {#dot} method is used to compute the dot product between two vectors.
280
284
  #
281
285
  # @example
282
- # vector = Geom::Vector3d.new 0,0,1
283
- # vector2 = Geom::Vector3d.new 0,1,0
284
- # d = vector.dot vector2
286
+ # vector1 = Geom::Vector3d.new(0, 0, 1)
287
+ # vector2 = Geom::Vector3d.new(0, 1, 0)
288
+ # dot = vector1.dot(vector2)
285
289
  #
286
- # @param vector2
287
- # A Vector3d object.
290
+ # @param [Geom::Vector] vector
291
+ #
292
+ # @return [Float]
288
293
  #
289
- # @return d - the dot product of vector1 and vector2
294
+ # @see #%
290
295
  #
291
296
  # @version SketchUp 6.0
292
- def dot(vector2)
297
+ def dot(vector)
293
298
  end
294
299
 
295
300
  # The new method is used to create a new vector.
File without changes
File without changes
@@ -59,8 +59,7 @@ class Sketchup::AttributeDictionaries < Sketchup::Entity
59
59
  # dictionaries = model.attribute_dictionaries
60
60
  # number = dictionaries.count
61
61
  #
62
- # @return [Integer] the number of attribute dictionary objects
63
- # in the collection.
62
+ # @return [Integer]
64
63
  #
65
64
  # @see #length
66
65
  #
@@ -110,8 +109,6 @@ class Sketchup::AttributeDictionaries < Sketchup::Entity
110
109
  # The {#length} method returns the number of attribute dictionary objects in
111
110
  # the collection.
112
111
  #
113
- # The {#size} method is an alias for {#length}.
114
- #
115
112
  # @example
116
113
  # model = Sketchup.active_model
117
114
  # model.set_attribute('Example', 'Hello', 'World')
@@ -121,23 +118,23 @@ class Sketchup::AttributeDictionaries < Sketchup::Entity
121
118
  # @return [Integer] the number of attribute dictionary objects in the
122
119
  # collection.
123
120
  #
121
+ # @see #size
122
+ #
124
123
  # @version SketchUp 2014
125
124
  def length
126
125
  end
127
126
 
128
- # The {#length} method returns the number of attribute dictionary objects in
129
- # the collection.
130
- #
131
- # The {#size} method is an alias for {#length}.
127
+ # The {#size} method is an alias of {#length}.
132
128
  #
133
129
  # @example
134
130
  # model = Sketchup.active_model
135
131
  # model.set_attribute('Example', 'Hello', 'World')
136
132
  # dictionaries = model.attribute_dictionaries
137
- # number = dictionaries.length
133
+ # number = dictionaries.size
138
134
  #
139
- # @return [Integer] the number of attribute dictionary objects in the
140
- # collection.
135
+ # @return [Integer]
136
+ #
137
+ # @see #length
141
138
  #
142
139
  # @version SketchUp 2014
143
140
  def size
@@ -77,7 +77,7 @@ class Sketchup::AttributeDictionary < Sketchup::Entity
77
77
  # dictionary = model.attribute_dictionary('Example')
78
78
  # number = dictionary.count
79
79
  #
80
- # @return [Integer] the size of the attribute dictionary.
80
+ # @return [Integer]
81
81
  #
82
82
  # @version SketchUp 2014
83
83
  def count
@@ -105,79 +105,83 @@ class Sketchup::AttributeDictionary < Sketchup::Entity
105
105
  def delete_key(key)
106
106
  end
107
107
 
108
- # An alias for each. See AttributeDictionary.each.
109
- #
110
- # Throws an exception if there are no keys.
108
+ # The {#each} method iterate through all of the attributes.
111
109
  #
112
110
  # @example
113
111
  # create_if_nil = true
114
112
  # model = Sketchup.active_model
115
- # attrdict = model.attribute_dictionary "test_dict", create_if_nil
113
+ # attrdict = model.attribute_dictionary("test_dict", create_if_nil)
116
114
  # attrdict["attr_one"] = "one"
117
115
  # attrdict["attr_two"] = "two"
118
116
  #
119
- # # iterates through all attributes and prints the key to the screen
117
+ # # Iterates through all attributes and prints the key to the screen.
120
118
  # attrdict = model.attribute_dictionaries['test_dict']
121
- # attrdict.each_pair { | key, value |
122
- # UI.messagebox key.to_s + '=' + value.to_s
119
+ # attrdict.each { | key, value |
120
+ # puts "#{key} = #{value}"
123
121
  # }
124
122
  #
125
- # @return nil
123
+ # @see #each_pair
126
124
  #
127
125
  # @version SketchUp 6.0
128
126
  #
129
- # @yield [key, value] @yieldparam key The key of each attribute as it is found.
130
- # @yieldparam value The value of each attribute as it is found.
127
+ # @yield [key, value]
128
+ #
129
+ # @yieldparam [Object] value
130
+ # The value of each attribute as it is found.
131
+ #
132
+ # @yieldparam [String] key
133
+ # The key of each attribute as it is found.
131
134
  def each
132
135
  end
133
136
 
134
- # The each_key method is used to iterate through all of the attribute keys.
135
- # This is the same method as AttributeDictionary.each.
136
- #
137
- # Throws an exception if there are no keys.
137
+ # The {#each_key} method is used to iterate through all of the attribute keys.
138
138
  #
139
139
  # @example
140
140
  # create_if_nil = true
141
141
  # model = Sketchup.active_model
142
- # attrdict = model.attribute_dictionary "test_dict", create_if_nil
142
+ # attrdict = model.attribute_dictionary("test_dict", create_if_nil)
143
143
  # attrdict["attr_one"] = "one"
144
144
  # attrdict["attr_two"] = "two"
145
145
  #
146
146
  # # iterates through all attributes and prints the key to the screen
147
147
  # attrdict = model.attribute_dictionaries['test_dict']
148
- # attrdict.each_key { | key | UI.messagebox key }
148
+ # attrdict.each_key { |key| puts key }
149
149
  #
150
- # @return nil
150
+ # @return [nil]
151
151
  #
152
152
  # @version SketchUp 6.0
153
153
  #
154
- # @yield [key] A variable that will hold each key as they are found.
154
+ # @yieldparam [String] key
155
+ # The key of each attribute as it is found.
155
156
  def each_key
156
157
  end
157
158
 
158
- # An alias for each. See AttributeDictionary.each.
159
- #
160
- # Throws an exception if there are no keys.
159
+ # The {#each_pair} method is an alias for {#each}.
161
160
  #
162
161
  # @example
163
162
  # create_if_nil = true
164
163
  # model = Sketchup.active_model
165
- # attrdict = model.attribute_dictionary "test_dict", create_if_nil
164
+ # attrdict = model.attribute_dictionary("test_dict", create_if_nil)
166
165
  # attrdict["attr_one"] = "one"
167
166
  # attrdict["attr_two"] = "two"
168
167
  #
169
168
  # # iterates through all attributes and prints the key to the screen
170
169
  # attrdict = model.attribute_dictionaries['test_dict']
171
170
  # attrdict.each_pair { | key, value |
172
- # UI.messagebox key.to_s + '=' + value.to_s
171
+ # puts "#{key} = #{value}"
173
172
  # }
174
173
  #
175
- # @return nil
174
+ # @see #each
176
175
  #
177
176
  # @version SketchUp 6.0
178
177
  #
179
- # @yield [key, value] @yieldparam key The key of each attribute as it is found.
180
- # @yieldparam value The value of each attribute as it is found.
178
+ # @yield [key, value]
179
+ #
180
+ # @yieldparam [Object] value
181
+ # The value of each attribute as it is found.
182
+ #
183
+ # @yieldparam [String] key
184
+ # The key of each attribute as it is found.
181
185
  def each_pair
182
186
  end
183
187
 
@@ -204,16 +208,15 @@ class Sketchup::AttributeDictionary < Sketchup::Entity
204
208
  # The {#length} method is used to retrieve the size (number of elements) of an
205
209
  # attribute dictionary.
206
210
  #
207
- # The {#size} method is an alias for {#length}.
208
- #
209
211
  # @example
210
212
  # model = Sketchup.active_model
211
213
  # model.set_attribute('Example', 'Hello', 'World')
212
214
  # dictionary = model.attribute_dictionary('Example')
213
215
  # number = dictionary.length
214
216
  #
215
- # @return [Integer] the size of the attribute dictionary if
216
- # successful
217
+ # @return [Integer]
218
+ #
219
+ # @see #size
217
220
  #
218
221
  # @version SketchUp 6.0
219
222
  def length
@@ -238,19 +241,17 @@ class Sketchup::AttributeDictionary < Sketchup::Entity
238
241
  def name
239
242
  end
240
243
 
241
- # The {#length} method is used to retrieve the size (number of elements) of an
242
- # attribute dictionary.
243
- #
244
- # The {#size} method is an alias for {#length}.
244
+ # The {#size} method is an alias of {#length}.
245
245
  #
246
246
  # @example
247
247
  # model = Sketchup.active_model
248
248
  # model.set_attribute('Example', 'Hello', 'World')
249
249
  # dictionary = model.attribute_dictionary('Example')
250
- # number = dictionary.length
250
+ # number = dictionary.size
251
251
  #
252
- # @return [Integer] the size of the attribute dictionary if
253
- # successful
252
+ # @return [Integer]
253
+ #
254
+ # @see #length
254
255
  #
255
256
  # @version SketchUp 6.0
256
257
  def size
@@ -60,12 +60,14 @@ class Sketchup::Classifications
60
60
  def keys
61
61
  end
62
62
 
63
- # The length method returns the number of loaded classification schemas.
63
+ # The {#length} method returns the number of loaded classification schemas.
64
64
  #
65
65
  # @example
66
- # Sketchup.active_model.classifications.size
66
+ # Sketchup.active_model.classifications.length
67
+ #
68
+ # @return [Integer]
67
69
  #
68
- # @return integer - number of ClassificationSchema object
70
+ # @see #size
69
71
  #
70
72
  # @version SketchUp 2015
71
73
  def length
@@ -88,12 +90,14 @@ class Sketchup::Classifications
88
90
  def load_schema(file)
89
91
  end
90
92
 
91
- # The length method returns the number of loaded classification schemas.
93
+ # The {#size} method returns the number of loaded classification schemas.
92
94
  #
93
95
  # @example
94
96
  # Sketchup.active_model.classifications.size
95
97
  #
96
- # @return integer - number of ClassificationSchema object
98
+ # @return [Integer]
99
+ #
100
+ # @see #length
97
101
  #
98
102
  # @version SketchUp 2015
99
103
  def size
@@ -154,15 +154,14 @@ class Sketchup::DefinitionList < Sketchup::Entity
154
154
  # The {#length} method is used to retrieve number of component definitions in
155
155
  # the list.
156
156
  #
157
- # The {#size} method is an alias for {#length} added in SketchUp 2014.
158
- #
159
157
  # @example
160
158
  # model = Sketchup.active_model
161
159
  # definitions = model.definitions
162
160
  # number = definitions.length
163
161
  #
164
- # @return [Integer] the number of component definitions in the
165
- # definition list if successful
162
+ # @return [Integer]
163
+ #
164
+ # @see #size
166
165
  #
167
166
  # @version SketchUp 6.0
168
167
  def length
@@ -276,20 +275,18 @@ class Sketchup::DefinitionList < Sketchup::Entity
276
275
  def remove_observer(observer)
277
276
  end
278
277
 
279
- # The {#length} method is used to retrieve number of component definitions in
280
- # the list.
281
- #
282
- # The {#size} method is an alias for {#length} added in SketchUp 2014.
278
+ # The {#size} method is an alias for {#length}.
283
279
  #
284
280
  # @example
285
281
  # model = Sketchup.active_model
286
282
  # definitions = model.definitions
287
- # number = definitions.length
283
+ # number = definitions.size
288
284
  #
289
- # @return [Integer] the number of component definitions in the
290
- # definition list if successful
285
+ # @return [Integer]
291
286
  #
292
- # @version SketchUp 6.0
287
+ # @see #length
288
+ #
289
+ # @version SketchUp 2014
293
290
  def size
294
291
  end
295
292