sketchup-api-stubs 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26637fb494dcc7f44b4445e237bbf28a252bfdf5
4
- data.tar.gz: a67eeba59e499c9235d43efbcc465fe02e50f956
3
+ metadata.gz: 971d247dca78409c1ad07c0ac8b617950e0f45fd
4
+ data.tar.gz: 1c357742608d50bc22df3031164b08589fa2f34c
5
5
  SHA512:
6
- metadata.gz: 0ec84ecbee17a6d05970cb9f6a7f322a58ab6109fedd91cf6d2cdd68bd01f4133dd795f0ae1043add96f83022edbcd58f7ad487987a07d8df5d94e3bcb6d9b70
7
- data.tar.gz: 878cd1af89b83c621221cee370737ff18ca5a3c24240434293f421fb65164bc43fdb42d2c788a47f43a4b9274ac47c189e1350fa672ab7022095a3450a2af9cd
6
+ metadata.gz: 17b8031751feab019808184440b8de1622d7afc79e24970ae281863588f857bb027e8038a3f7fa1e930d8e081b643bbaee58e223d273026c3a797eda07da8442
7
+ data.tar.gz: dba9df82eba6d586d3ddbc40c2d250a08e678ce255ce18aa047491b90d19a4ccca4a5ab23f1434e46717f48f9e84c04bc9c99f0cde1efffedddc983b5742d58f
@@ -6,69 +6,61 @@
6
6
  # draw the model.
7
7
  #
8
8
  # @example
9
- # # Get a handle to the styles collection.
10
9
  # styles = Sketchup.active_model.styles
11
- #
12
- # # Display the name of the first style.
13
- # first_style = styles[0]
14
- # UI.messagebox("Your first style is named " + first_style.name.to_s)
10
+ # puts "Your first style is named #{styles.first.name}"
15
11
  #
16
12
  # @version SketchUp 6.0
17
13
  class Sketchup::Style < Sketchup::Entity
18
14
 
19
15
  # Instance Methods
20
16
 
21
- # The description method is used to retrieve the description for a style.
17
+ # The {#description} method gets the description for a {Sketchup::Style}.
22
18
  #
23
19
  # @example
24
- # style = Sketchup.active_model.styles[0]
25
- # UI.messagebox("Your first style description is: " +
26
- # style.description.to_s)
20
+ # styles = Sketchup.active_model.styles
21
+ # style = styles.first
22
+ # puts "Your first style description is: #{style.description}"
27
23
  #
28
- # @return description - the description for the style.
24
+ # @return [String] description
29
25
  #
30
26
  # @version SketchUp 6.0
31
27
  def description
32
28
  end
33
29
 
34
- # The description= method is used to set a description for a style.
30
+ # The {#description=} method sets the description for a {Sketchup::Style}.
35
31
  #
36
32
  # @example
37
- # style = Sketchup.active_model.styles[0]
33
+ # styles = Sketchup.active_model.styles
34
+ # style = styles.first
38
35
  # style.description = "My new style description."
39
- # UI.messagebox('My new style description is: ' + style.description)
40
- #
41
- # @param description
42
- # A textual description of the style.
43
36
  #
44
- # @return status - true if successful, false if unsuccessful.
37
+ # @param [String] description
45
38
  #
46
39
  # @version SketchUp 6.0
47
40
  def description=(description)
48
41
  end
49
42
 
50
- # The name method is used to retrieve the name for a style.
43
+ # The {#name} method gets the name for a {Sketchup::Style}.
51
44
  #
52
45
  # @example
46
+ # styles = Sketchup.active_model.styles
47
+ # style = styles.first
53
48
  # name = style.name
54
49
  #
55
- # @return name - the name for the style.
50
+ # @return [String]
56
51
  #
57
52
  # @version SketchUp 6.0
58
53
  def name
59
54
  end
60
55
 
61
- # The name= method is used to set the name for a style.
56
+ # The {#name=} method sets the name for a {Sketchup::Style}.
62
57
  #
63
58
  # @example
64
- # style = Sketchup.active_model.styles[0]
59
+ # styles = Sketchup.active_model.styles
60
+ # style = styles.first
65
61
  # style.name = 'My Very Own Style'
66
- # UI.messagebox('My new style name is: ' + style.name)
67
- #
68
- # @param name
69
- # - the new name for the style.
70
62
  #
71
- # @return name - the name that was set.
63
+ # @param [String] name
72
64
  #
73
65
  # @version SketchUp 6.0
74
66
  def name=(name)
@@ -6,7 +6,7 @@
6
6
  #
7
7
  # @example
8
8
  # styles = Sketchup.active_model.styles
9
- # UI.messagebox "There are " + styles.count.to_s + " styles in your model."
9
+ # puts "There are #{styles.size} styles in your model."
10
10
  #
11
11
  # @version SketchUp 6.0
12
12
  class Sketchup::Styles < Sketchup::Entity
@@ -17,65 +17,67 @@ class Sketchup::Styles < Sketchup::Entity
17
17
 
18
18
  # Instance Methods
19
19
 
20
- # The [] method is used to retrieves a style by either name or index.
20
+ # The {#[]} method is used to retrieves a style by either name or index.
21
21
  #
22
22
  # @example
23
23
  # styles = Sketchup.active_model.styles
24
24
  # style1 = styles[0]
25
- # style2 = styles["name"]
25
+ # style2 = styles["MyStyle"]
26
26
  #
27
- # @param name_or_index
28
- # The string name or index for a specific style.
27
+ # @overload [](name)
29
28
  #
30
- # @return style - a Style object if successful
29
+ # @param [String] name The name of the style to retrieve.
30
+ # @return [Sketchup::Style, nil]
31
+ #
32
+ # @overload [](index)
33
+ #
34
+ # @param [Integer] index The index of the style to retrieve.
35
+ # @return [Sketchup::Style, nil]
31
36
  #
32
37
  # @version SketchUp 6.0
33
- def [](name_or_index)
38
+ def [](arg)
34
39
  end
35
40
 
36
- # The active_style method is used to retrieve the active style.
41
+ # The #{active_style} method is used to retrieve the active style.
37
42
  #
38
43
  # @example
39
44
  # styles = Sketchup.active_model.styles
40
45
  # style = styles.active_style
41
- # UI.messagebox('The active style is: ' + active_style.name)
42
46
  #
43
- # @return style - the active Style object.
47
+ # @return [Sketchup::Style]
44
48
  #
45
49
  # @version SketchUp 6.0
46
50
  def active_style
47
51
  end
48
52
 
49
- # The active_style_changed method tells you if the active style has been
53
+ # The {#active_style_changed} method tells you if the active style has been
50
54
  # edited by the user since it was last saved.
51
55
  #
52
56
  # @example
53
57
  # styles = Sketchup.active_model.styles
54
- # user_made_change = styles.active_style_changed
55
- # UI.messagebox ('The active style was edited: ' + user_made_change.to_s)
58
+ # style_changed = styles.active_style_changed
56
59
  #
57
- # @return changed - true if the active style has been changed
58
- # from when it was last saved.
60
+ # @return [Boolean]
59
61
  #
60
62
  # @version SketchUp 6.0
61
63
  def active_style_changed
62
64
  end
63
65
 
64
- # The add_style method is used to create and load a style from the given file.
66
+ # The {#add_style} method is used to create and load a style from the given
67
+ # file.
65
68
  #
66
69
  # @example
70
+ # filename = File.expand_path('./MyStyle.style')
67
71
  # styles = Sketchup.active_model.styles
68
- # status = styles.add_style "c:\\MyStyle.style", true
69
- # UI.messagebox ('A style was added: ' + status.to_s)
72
+ # status = styles.add_style(filename, true)
70
73
  #
71
- # @param filename
72
- # The filename for the style.
74
+ # @param [String] filename
73
75
  #
74
- # @param select
75
- # true if you want to set the style to be the active
76
- # style, false if not.
76
+ # @param [Boolean] select
77
+ # +true+ if you want to set the style to be the
78
+ # active style.
77
79
  #
78
- # @return status - true if successful, false if unsuccessful.
80
+ # @return [Boolean]
79
81
  #
80
82
  # @version SketchUp 6.0
81
83
  def add_style(filename, select)
@@ -90,25 +92,25 @@ class Sketchup::Styles < Sketchup::Entity
90
92
  # +Enumable+ mix-in module. Prior to that the {#count} method is an alias
91
93
  # for {#length}.
92
94
  #
93
- # @return integer - the number of styles found.
95
+ # @return [Integer]
94
96
  #
95
97
  # @version SketchUp 6.0
96
98
  def count
97
99
  end
98
100
 
99
- # The each method is used to iterate through styles.
101
+ # The {#each} method is used to iterate through styles.
100
102
  #
101
103
  # @example
102
104
  # styles = Sketchup.active_model.styles
103
- # styles.each {| style |
104
- # UI.messagebox('style: ' + style.name)
105
+ # styles.each { |style|
106
+ # puts style.name
105
107
  # }
106
108
  #
107
- # @return nil
109
+ # @return [nil]
108
110
  #
109
111
  # @version SketchUp 6.0
110
112
  #
111
- # @yield [style] Variable that will hold each style as it is found.
113
+ # @yieldparam [Sketchup::Style] style
112
114
  def each
113
115
  end
114
116
 
@@ -126,46 +128,51 @@ class Sketchup::Styles < Sketchup::Entity
126
128
  def length
127
129
  end
128
130
 
129
- # parent pointer, so we can't use the normal "parent" method from Entity
131
+ # The {#parent} method is used to return the model for the styles.
132
+ #
133
+ # @example
134
+ # styles = Sketchup.active_model.styles
135
+ # model = styles.parent
136
+ #
137
+ # @return [Sketchup::Model]
138
+ #
139
+ # @version SketchUp 6.0
130
140
  def parent
131
141
  end
132
142
 
133
- # The purge_unused method is used to remove unused styles from the model.
143
+ # The {#purge_unused} method is used to remove unused styles from the model.
134
144
  #
135
145
  # @example
136
146
  # styles = Sketchup.active_model.styles
137
- # status = styles.purge_unused
138
- # UI.messagebox ('Purging Unused styles status: ' + status.to_s)
147
+ # styles.purge_unused
139
148
  #
140
- # @return status - true if successful, false if unsuccessful.
149
+ # @return [true]
141
150
  #
142
151
  # @version SketchUp 6.0
143
152
  def purge_unused
144
153
  end
145
154
 
146
- # The selected_style method is used to retrieve the currently selected style.
155
+ # The {#selected_style} method is used to retrieve the currently selected style.
147
156
  #
148
157
  # @example
149
158
  # styles = Sketchup.active_model.styles
150
159
  # style = styles.selected_style
151
- # UI.messagebox ('The selected style is: ' + style.name)
152
160
  #
153
- # @return style - the selected Style object.
161
+ # @return [Sketchup::Style] style
154
162
  #
155
163
  # @version SketchUp 6.0
156
164
  def selected_style
157
165
  end
158
166
 
159
- # The selected_style= method is used to set the currently selected style.
167
+ # The {#selected_style=} method is used to set the currently selected style.
160
168
  #
161
169
  # @example
162
170
  # styles = Sketchup.active_model.styles
163
- # styles.selected_style = styles[styles.count -1]
171
+ # styles.selected_style = styles.last
164
172
  #
165
- # @param style
166
- # The style object to select.
173
+ # @param [Sketchup::Style] style
167
174
  #
168
- # @return false
175
+ # @return [false]
169
176
  #
170
177
  # @version SketchUp 6.0
171
178
  def selected_style=(style)
@@ -186,15 +193,16 @@ class Sketchup::Styles < Sketchup::Entity
186
193
  def size
187
194
  end
188
195
 
189
- # The update_selected_style method returns true if the selected style
190
- # was changed (e.g. the user selected a different style).
196
+ # The {#update_selected_style} method commits the current style settings to the
197
+ # style selected in the Style Browser.
191
198
  #
192
199
  # @example
193
200
  # styles = Sketchup.active_model.styles
194
- # success = styles.update_selected_style
195
- # UI.messagebox ('The selected style was switched: ' + success.to_s)
201
+ # styles.update_selected_style
202
+ #
203
+ # @return [true]
196
204
  #
197
- # @return status - true if the style was switched
205
+ # @see #selected_style
198
206
  #
199
207
  # @version SketchUp 6.0
200
208
  def update_selected_style
@@ -27,9 +27,9 @@
27
27
  #
28
28
  # - +CONSTRAIN_MODIFIER_KEY+ = Shift Key
29
29
  # - +CONSTRAIN_MODIFIER_MASK+ = Shift Key
30
- # - +COPY_MODIFIER_KEY+ = Menu on Mac, Ctrl on PC
31
- # - +COPY_MODIFIER_MASK+ = Alt on Mac, Ctrl on PC
32
- # - +ALT_MODIFIER_KEY+ = Command on Mac, Menu on PC
30
+ # - +COPY_MODIFIER_KEY+ = Alt/Option on Mac, Ctrl on PC
31
+ # - +COPY_MODIFIER_MASK+ = Alt/Option on Mac, Ctrl on PC
32
+ # - +ALT_MODIFIER_KEY+ = Command on Mac, Alt on PC
33
33
  # - +ALT_MODIFIER_MASK+ = Command on Mac, Alt on PC
34
34
  #
35
35
  # @version SketchUp 6.0
@@ -48,7 +48,7 @@ module Sketchup
48
48
  # # code acting on the model
49
49
  # end
50
50
  #
51
- # @return model - active model object if successful, false if
51
+ # @return [Sketchup::Model] model - active model object if successful, false if
52
52
  # unsuccessful
53
53
  #
54
54
  # @version SketchUp 6.0
@@ -725,15 +725,15 @@ module Sketchup
725
725
  end
726
726
 
727
727
  # The read_default method is used to retrieve the string associated with a
728
- # value within the specified sub-section section of a .INI file or registry
729
- # (within the Software > SketchUp > SketchUp [Version] section).
728
+ # value within the specified sub-section section of a .INI file or registry
729
+ # (within the Software > SketchUp > SketchUp [Version] section).
730
730
  #
731
731
  # @example
732
- # result = Sketchup.read_default "section",
733
- # "variable", "default"
732
+ # result = Sketchup.read_default "section",
733
+ # "variable", "default"
734
734
  #
735
735
  # @param section
736
- # A section in an .INI or registry.
736
+ # A section in an .INI or registry.
737
737
  #
738
738
  # @param variable
739
739
  # A variable within the section.
@@ -1264,16 +1264,16 @@ module Sketchup
1264
1264
  end
1265
1265
 
1266
1266
  # The write_default method is used to set the string associated with a
1267
- # variable within the specified sub-section of a .plist file on the Mac
1268
- # or the registry on Windows
1269
- # (within the Software > SketchUp > SketchUp [Version] section).
1267
+ # variable within the specified sub-section of a .plist file on the Mac
1268
+ # or the registry on Windows
1269
+ # (within the Software > SketchUp > SketchUp [Version] section).
1270
1270
  #
1271
1271
  # @example
1272
1272
  # result = Sketchup.write_default("section", "key", "my_value")
1273
1273
  #
1274
1274
  # @param [String] section
1275
- # A section in a .plist file (Mac) or the registry
1276
- # (Windows).
1275
+ # A section in a .plist file (Mac) or the registry
1276
+ # (Windows).
1277
1277
  #
1278
1278
  # @param [String] key
1279
1279
  # A key within the section.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sketchup-api-stubs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trimble Inc, SketchUp Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-16 00:00:00.000000000 Z
11
+ date: 2017-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler