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
@@ -7,35 +7,35 @@
7
7
  #
8
8
  # To make a set of your own, create an empty one using Sketchup::Set.new, and
9
9
  # then add items to it.
10
- # Note that in SketchUp 2014 this class was changed from Set to Sketchup::Set
11
- # in order to avoid conflict with the Ruby Standard Library. The Sketchup::Set
12
- # class is deprecated and new extensions should make use of Ruby's Set class
13
- # unless they need backward compatibility.
14
10
  #
15
- # If you want to ensure backwards compatibility you can use this shim:
11
+ # @deprecated In SketchUp 2014 this class was changed from +Set+
12
+ # to +Sketchup::Set+ in order to avoid conflict with the Ruby Standard
13
+ # Library. The +Sketchup::Set+ class is deprecated and new extensions should
14
+ # make use of Ruby's +Set+ class unless they need backward compatibility.
16
15
  #
17
16
  # @example
17
+ # set = Sketchup::Set.new
18
+ # set.insert(1)
19
+ # set.insert(2)
20
+ #
21
+ # @example Compatibility Shim
18
22
  # module Example
19
23
  #
20
24
  # # Shim for the Set class which was moved in SketchUp 2014
21
25
  # if defined?(Sketchup::Set)
26
+ # # Warning! Do NOT do this in the global namespace!
22
27
  # Set = Sketchup::Set
23
28
  # end
24
29
  #
25
30
  # def self.test_set_shim
26
- # s = Set.new
27
- # s.insert('Hello')
28
- # s.insert('World')
29
- # puts s.to_a
31
+ # set = Set.new
32
+ # set.insert('Hello')
33
+ # set.insert('World')
34
+ # puts set.to_a
30
35
  # end
31
36
  #
32
37
  # end
33
38
  #
34
- # @example
35
- # my_set = Sketchup::Set.new
36
- # my_set.insert entity1
37
- # my_set.insert entity2
38
- #
39
39
  # @version SketchUp 6.0
40
40
  class Sketchup::Set
41
41
 
@@ -45,19 +45,10 @@ class Sketchup::Set
45
45
  #
46
46
  # @example
47
47
  # set = Sketchup::Set.new
48
- # toolbar = UI::Toolbar.new "Test"
49
- # set.insert toolbar
50
- # if (set.include? toolbar)
51
- # UI.messagebox "Success: Contains Toolbar Object"
52
- # else
53
- # UI.messagebox "Failure"
54
- # end
48
+ # set.insert(1)
49
+ # set.insert(2)
50
+ # set.insert(3)
55
51
  # set.clear
56
- # if (set.include? toolbar)
57
- # UI.messagebox set
58
- # else
59
- # UI.messagebox "Set is empty"
60
- # end
61
52
  #
62
53
  # @return set - an empty Set object
63
54
  #
@@ -65,47 +56,34 @@ class Sketchup::Set
65
56
  def clear
66
57
  end
67
58
 
68
- # The contains? method is an alias for include?. See also Set.include?
59
+ # The {#contains?} method is an alias for {#include?}.
69
60
  #
70
61
  # @example
71
62
  # set = Sketchup::Set.new
72
- # toolbar = UI::Toolbar.new "Test"
73
- # set.insert toolbar
74
- # if (set.contains? toolbar)
75
- # UI.messagebox "Success: Contains Toolbar Object"
76
- # else
77
- # UI.messagebox "Failure"
78
- # end
63
+ # set.insert(1)
64
+ # set.insert(2)
65
+ # set.insert(3)
66
+ # p set.contains?(2)
79
67
  #
80
- # @param object
81
- # A Ruby object of any type.
68
+ # @param [Sketchup::Entity] entity
82
69
  #
83
- # @return status - true if the set contains the object, false if
84
- # the set does not contain the object.
70
+ # @return [Boolean]
85
71
  #
86
72
  # @return [Boolean]
87
73
  #
74
+ # @see #include?
75
+ #
88
76
  # @version SketchUp 6.0
89
- def contains?(object)
77
+ def contains?(entity)
90
78
  end
91
79
 
92
80
  # The delete object is used to delete or remove an object from the set.
93
81
  #
94
82
  # @example
95
83
  # set = Sketchup::Set.new
96
- # toolbar = UI::Toolbar.new "Test"
97
- # set.insert toolbar
98
- # if (set.include? toolbar)
99
- # UI.messagebox "Success: Contains Toolbar Object"
100
- # else
101
- # UI.messagebox "Failure"
102
- # end
103
- # set.delete toolbar
104
- # if (set.include? toolbar)
105
- # UI.messagebox set
106
- # else
107
- # UI.messagebox "Set is empty"
108
- # end
84
+ # set.insert(1)
85
+ # set.insert(2)
86
+ # set.delete(1)
109
87
  #
110
88
  # @param object
111
89
  # The object to be deleted.
@@ -120,9 +98,10 @@ class Sketchup::Set
120
98
  #
121
99
  # @example
122
100
  # set = Sketchup::Set.new
123
- # toolbar = UI::Toolbar.new "Test"
124
- # set.insert toolbar
125
- # set.each { | item | UI.messagebox item }
101
+ # set.insert(1)
102
+ # set.insert(2)
103
+ # set.insert(3)
104
+ # set.each { | item | puts item }
126
105
  #
127
106
  # @version SketchUp 6.0
128
107
  #
@@ -134,14 +113,10 @@ class Sketchup::Set
134
113
  #
135
114
  # @example
136
115
  # set = Sketchup::Set.new
137
- # toolbar = UI::Toolbar.new "Test"
138
- # set.insert toolbar
139
- # status = set.empty?
140
- # if (status)
141
- # UI.messagebox "Success: Set is Empty"
142
- # else
143
- # UI.messagebox "Failure: Set has an Item"
144
- # end
116
+ # set.insert(1)
117
+ # set.insert(2)
118
+ # set.insert(3)
119
+ # puts set.empty?
145
120
  #
146
121
  # @return status - true if the set is empty, false if it is not
147
122
  # empty.
@@ -152,41 +127,35 @@ class Sketchup::Set
152
127
  def empty?
153
128
  end
154
129
 
155
- # The contains? method is an alias for include?. See also Set.include?
130
+ # The {#include?} method is used to determine if the set includes a particular
131
+ # object.
156
132
  #
157
133
  # @example
158
134
  # set = Sketchup::Set.new
159
- # toolbar = UI::Toolbar.new "Test"
160
- # set.insert toolbar
161
- # if (set.contains? toolbar)
162
- # UI.messagebox "Success: Contains Toolbar Object"
163
- # else
164
- # UI.messagebox "Failure"
165
- # end
135
+ # set.insert(1)
136
+ # set.insert(2)
137
+ # set.insert(3)
138
+ # p set.include?(2)
166
139
  #
167
- # @param object
168
- # A Ruby object of any type.
140
+ # @param [Sketchup::Entity] entity
169
141
  #
170
- # @return status - true if the set contains the object, false if
171
- # the set does not contain the object.
142
+ # @return [Boolean]
172
143
  #
173
144
  # @return [Boolean]
174
145
  #
146
+ # @see #contains?
147
+ #
175
148
  # @version SketchUp 6.0
176
- def include?(object)
149
+ def include?(entity)
177
150
  end
178
151
 
179
152
  # The insert method is used to insert an object into the set.
180
153
  #
181
154
  # @example
182
155
  # set = Sketchup::Set.new
183
- # toolbar = UI::Toolbar.new "Test"
184
- # set.insert toolbar
185
- # if (set.include? toolbar)
186
- # UI.messagebox "Success: Contains Toolbar Object"
187
- # else
188
- # UI.messagebox "Failure"
189
- # end
156
+ # set.insert(1)
157
+ # set.insert(2)
158
+ # set.insert(3)
190
159
  #
191
160
  # @param object
192
161
  # The object to be inserted into the set.
@@ -197,39 +166,35 @@ class Sketchup::Set
197
166
  def insert(object)
198
167
  end
199
168
 
200
- # The length method is an alias for size. See also Set.size.
169
+ # The {#length} method is an alias for {#size}.
201
170
  #
202
171
  # @example
203
172
  # set = Sketchup::Set.new
204
- # toolbar = UI::Toolbar.new "Test"
205
- # set.insert toolbar
206
- # length = set.length
207
- # if (length)
208
- # UI.messagebox length
209
- # else
210
- # UI.messagebox "Failure"
211
- # end
173
+ # set.insert(1)
174
+ # set.insert(2)
175
+ # set.insert(3)
176
+ # puts set.length
212
177
  #
213
- # @return length - the length (number of objects) in the set
178
+ # @return [Integer]
179
+ #
180
+ # @see #size
214
181
  #
215
182
  # @version SketchUp 6.0
216
183
  def length
217
184
  end
218
185
 
219
- # The length method is an alias for size. See also Set.size.
186
+ # The {#size} method is used to determine the number of objects in the set.
220
187
  #
221
188
  # @example
222
189
  # set = Sketchup::Set.new
223
- # toolbar = UI::Toolbar.new "Test"
224
- # set.insert toolbar
225
- # length = set.length
226
- # if (length)
227
- # UI.messagebox length
228
- # else
229
- # UI.messagebox "Failure"
230
- # end
231
- #
232
- # @return length - the length (number of objects) in the set
190
+ # set.insert(1)
191
+ # set.insert(2)
192
+ # set.insert(3)
193
+ # puts set.size
194
+ #
195
+ # @return [Integer]
196
+ #
197
+ # @see #length
233
198
  #
234
199
  # @version SketchUp 6.0
235
200
  def size
@@ -138,26 +138,27 @@ class Sketchup::ShadowInfo < Sketchup::Entity
138
138
  def count
139
139
  end
140
140
 
141
- # An alias for each. See ShadowInfo.each.
141
+ # The {#each} method iterates through all of the shadow information key/value
142
+ # pairs.
142
143
  #
143
144
  # @example
144
145
  # model = Sketchup.active_model
145
- # shadowinfo = model.shadow_info
146
- # shadowinfo.each_pair { |key, value|
147
- # UI.messagebox(key.to_s + '=' + value.to_s)
146
+ # shadow_info = model.shadow_info
147
+ # shadow_info.each { |key, value|
148
+ # puts "#{key} : #{value}"
148
149
  # }
149
150
  #
150
- # @return nil
151
+ # @return [nil]
152
+ #
153
+ # @see #each_pair
151
154
  #
152
155
  # @version SketchUp 6.0
153
156
  #
154
157
  # @yield [key, value]
155
158
  #
156
- # @yieldparam key
157
- # A variables that will hold each key as it is found.
159
+ # @yieldparam [Object] value
158
160
  #
159
- # @yieldparam value
160
- # A variables that will hold each value as it is found.
161
+ # @yieldparam [String] key
161
162
  def each
162
163
  end
163
164
 
@@ -174,26 +175,26 @@ class Sketchup::ShadowInfo < Sketchup::Entity
174
175
  def each_key
175
176
  end
176
177
 
177
- # An alias for each. See ShadowInfo.each.
178
+ # The #{each_pair} method is an alias for {#each}.
178
179
  #
179
180
  # @example
180
181
  # model = Sketchup.active_model
181
- # shadowinfo = model.shadow_info
182
- # shadowinfo.each_pair { |key, value|
183
- # UI.messagebox(key.to_s + '=' + value.to_s)
182
+ # shadow_info = model.shadow_info
183
+ # shadow_info.each_pair { |key, value|
184
+ # puts "#{key} : #{value}"
184
185
  # }
185
186
  #
186
- # @return nil
187
+ # @return [nil]
188
+ #
189
+ # @see #each
187
190
  #
188
191
  # @version SketchUp 6.0
189
192
  #
190
193
  # @yield [key, value]
191
194
  #
192
- # @yieldparam key
193
- # A variables that will hold each key as it is found.
195
+ # @yieldparam [String] key
194
196
  #
195
- # @yieldparam value
196
- # A variables that will hold each value as it is found.
197
+ # @yieldparam [Object] value
197
198
  def each_pair
198
199
  end
199
200
 
@@ -212,13 +213,13 @@ class Sketchup::ShadowInfo < Sketchup::Entity
212
213
  # The {#length} method returns the number of options in the shadow options
213
214
  # collection
214
215
  #
215
- # The {#size} method is an alias for {#length}.
216
- #
217
216
  # @example
218
217
  # shadow_info = Sketchup.active_model.shadow_info
219
218
  # number = shadow_info.length
220
219
  #
221
- # @return integer
220
+ # @return [Integer]
221
+ #
222
+ # @see #size
222
223
  #
223
224
  # @version SketchUp 2014
224
225
  def length
@@ -239,16 +240,15 @@ class Sketchup::ShadowInfo < Sketchup::Entity
239
240
  def remove_observer(observer)
240
241
  end
241
242
 
242
- # The {#length} method returns the number of options in the shadow options
243
- # collection
244
- #
245
243
  # The {#size} method is an alias for {#length}.
246
244
  #
247
245
  # @example
248
246
  # shadow_info = Sketchup.active_model.shadow_info
249
- # number = shadow_info.length
247
+ # number = shadow_info.size
250
248
  #
251
- # @return integer
249
+ # @return [Integer]
250
+ #
251
+ # @see #length
252
252
  #
253
253
  # @version SketchUp 2014
254
254
  def size
@@ -112,18 +112,17 @@ class Sketchup::Styles < Sketchup::Entity
112
112
  def each
113
113
  end
114
114
 
115
- # The {#size} method is used to retrieve the number of styles in the
116
- # collection.
117
- #
118
115
  # The {#length} method is an alias of {#size}.
119
116
  #
120
117
  # @example
121
118
  # styles = Sketchup.active_model.styles
122
- # number = styles.size
119
+ # number = styles.length
123
120
  #
124
- # @return integer - the number of styles found.
121
+ # @return [Integer]
125
122
  #
126
- # @version SketchUp 6.0
123
+ # @see #size
124
+ #
125
+ # @version SketchUp 2014
127
126
  def length
128
127
  end
129
128
 
@@ -175,13 +174,13 @@ class Sketchup::Styles < Sketchup::Entity
175
174
  # The {#size} method is used to retrieve the number of styles in the
176
175
  # collection.
177
176
  #
178
- # The {#length} method is an alias of {#size}.
179
- #
180
177
  # @example
181
178
  # styles = Sketchup.active_model.styles
182
179
  # number = styles.size
183
180
  #
184
- # @return integer - the number of styles found.
181
+ # @return [Integer]
182
+ #
183
+ # @see #length
185
184
  #
186
185
  # @version SketchUp 6.0
187
186
  def size
File without changes
@@ -79,7 +79,7 @@ class UI::Toolbar
79
79
  # @example
80
80
  # number = toolbar.count
81
81
  #
82
- # @return integer
82
+ # @return [Integer]
83
83
  #
84
84
  # @version SketchUp 2014
85
85
  def count
@@ -151,12 +151,12 @@ class UI::Toolbar
151
151
 
152
152
  # The {#length} method returns the number of items in the toolbar.
153
153
  #
154
- # The {#size} method is an alias of {#length}.
155
- #
156
154
  # @example
157
155
  # number = toolbar.length
158
156
  #
159
- # @return integer
157
+ # @return [Integer]
158
+ #
159
+ # @see #size
160
160
  #
161
161
  # @version SketchUp 2014
162
162
  def length
@@ -214,14 +214,14 @@ class UI::Toolbar
214
214
  def show
215
215
  end
216
216
 
217
- # The {#length} method returns the number of items in the toolbar.
218
- #
219
217
  # The {#size} method is an alias of {#length}.
220
218
  #
221
219
  # @example
222
- # number = toolbar.length
220
+ # number = toolbar.size
221
+ #
222
+ # @return [Integer]
223
223
  #
224
- # @return integer
224
+ # @see #length
225
225
  #
226
226
  # @version SketchUp 2014
227
227
  def size