aspose_cad_cloud 19.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/lib/aspose_cad_cloud.rb +83 -0
  3. data/lib/aspose_cad_cloud/api/cad_api.rb +2138 -0
  4. data/lib/aspose_cad_cloud/api_client.rb +403 -0
  5. data/lib/aspose_cad_cloud/api_error.rb +54 -0
  6. data/lib/aspose_cad_cloud/configuration.rb +189 -0
  7. data/lib/aspose_cad_cloud/models/bmp_options_dto.rb +327 -0
  8. data/lib/aspose_cad_cloud/models/cad_rasterization_options_dto.rb +473 -0
  9. data/lib/aspose_cad_cloud/models/cad_response.rb +317 -0
  10. data/lib/aspose_cad_cloud/models/cff2_properties.rb +197 -0
  11. data/lib/aspose_cad_cloud/models/color.rb +312 -0
  12. data/lib/aspose_cad_cloud/models/dgn_properties.rb +197 -0
  13. data/lib/aspose_cad_cloud/models/drawing_options_base_dto.rb +281 -0
  14. data/lib/aspose_cad_cloud/models/dwf_properties.rb +197 -0
  15. data/lib/aspose_cad_cloud/models/dwg_properties.rb +197 -0
  16. data/lib/aspose_cad_cloud/models/dxf_properties.rb +197 -0
  17. data/lib/aspose_cad_cloud/models/gif_options_dto.rb +386 -0
  18. data/lib/aspose_cad_cloud/models/graphics_options.rb +311 -0
  19. data/lib/aspose_cad_cloud/models/ifc_properties.rb +197 -0
  20. data/lib/aspose_cad_cloud/models/igs_properties.rb +197 -0
  21. data/lib/aspose_cad_cloud/models/jpeg2000_options_dto.rb +322 -0
  22. data/lib/aspose_cad_cloud/models/jpeg_options_dto.rb +378 -0
  23. data/lib/aspose_cad_cloud/models/pdf_document_info.rb +237 -0
  24. data/lib/aspose_cad_cloud/models/pdf_document_options.rb +249 -0
  25. data/lib/aspose_cad_cloud/models/pdf_options_dto.rb +301 -0
  26. data/lib/aspose_cad_cloud/models/pen_options.rb +280 -0
  27. data/lib/aspose_cad_cloud/models/png_options_dto.rb +388 -0
  28. data/lib/aspose_cad_cloud/models/psd_options_dto.rb +388 -0
  29. data/lib/aspose_cad_cloud/models/rd_optimizer_settings.rb +302 -0
  30. data/lib/aspose_cad_cloud/models/requests/GetDrawingPropertiesRequest.rb +53 -0
  31. data/lib/aspose_cad_cloud/models/requests/GetDrawingResizeRequest.rb +69 -0
  32. data/lib/aspose_cad_cloud/models/requests/GetDrawingRotateFlipRequest.rb +65 -0
  33. data/lib/aspose_cad_cloud/models/requests/GetDrawingSaveAsRequest.rb +61 -0
  34. data/lib/aspose_cad_cloud/models/requests/PostDrawingBmpRequest.rb +61 -0
  35. data/lib/aspose_cad_cloud/models/requests/PostDrawingGifRequest.rb +61 -0
  36. data/lib/aspose_cad_cloud/models/requests/PostDrawingJpeg2000Request.rb +61 -0
  37. data/lib/aspose_cad_cloud/models/requests/PostDrawingJpegRequest.rb +61 -0
  38. data/lib/aspose_cad_cloud/models/requests/PostDrawingPdfRequest.rb +61 -0
  39. data/lib/aspose_cad_cloud/models/requests/PostDrawingPngRequest.rb +61 -0
  40. data/lib/aspose_cad_cloud/models/requests/PostDrawingPropertiesRequest.rb +45 -0
  41. data/lib/aspose_cad_cloud/models/requests/PostDrawingPsdRequest.rb +61 -0
  42. data/lib/aspose_cad_cloud/models/requests/PostDrawingResizeRequest.rb +65 -0
  43. data/lib/aspose_cad_cloud/models/requests/PostDrawingRotateFlipRequest.rb +61 -0
  44. data/lib/aspose_cad_cloud/models/requests/PostDrawingSaveAsRequest.rb +57 -0
  45. data/lib/aspose_cad_cloud/models/requests/PostDrawingSvgRequest.rb +61 -0
  46. data/lib/aspose_cad_cloud/models/requests/PostDrawingTiffRequest.rb +61 -0
  47. data/lib/aspose_cad_cloud/models/requests/PostDrawingWmfRequest.rb +61 -0
  48. data/lib/aspose_cad_cloud/models/requests/PutDrawingBmpRequest.rb +57 -0
  49. data/lib/aspose_cad_cloud/models/requests/PutDrawingGifRequest.rb +57 -0
  50. data/lib/aspose_cad_cloud/models/requests/PutDrawingJpeg2000Request.rb +57 -0
  51. data/lib/aspose_cad_cloud/models/requests/PutDrawingJpegRequest.rb +57 -0
  52. data/lib/aspose_cad_cloud/models/requests/PutDrawingPdfRequest.rb +57 -0
  53. data/lib/aspose_cad_cloud/models/requests/PutDrawingPngRequest.rb +57 -0
  54. data/lib/aspose_cad_cloud/models/requests/PutDrawingPsdRequest.rb +57 -0
  55. data/lib/aspose_cad_cloud/models/requests/PutDrawingSvgRequest.rb +57 -0
  56. data/lib/aspose_cad_cloud/models/requests/PutDrawingTiffRequest.rb +57 -0
  57. data/lib/aspose_cad_cloud/models/requests/PutDrawingWmfRequest.rb +57 -0
  58. data/lib/aspose_cad_cloud/models/resolution_setting.rb +227 -0
  59. data/lib/aspose_cad_cloud/models/stl_properties.rb +197 -0
  60. data/lib/aspose_cad_cloud/models/svg_options_dto.rb +327 -0
  61. data/lib/aspose_cad_cloud/models/tiff_options_dto.rb +417 -0
  62. data/lib/aspose_cad_cloud/models/vector_rasterization_options_dto.rb +363 -0
  63. data/lib/aspose_cad_cloud/models/wmf_options_dto.rb +296 -0
  64. data/lib/aspose_cad_cloud/version.rb +29 -0
  65. metadata +178 -0
@@ -0,0 +1,403 @@
1
+ # -----------------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="api_client.rb">
3
+ # Copyright (c) 2018 Aspose.CAD Cloud
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ # SOFTWARE.
23
+ # </summary>
24
+ # -----------------------------------------------------------------------------------
25
+
26
+ require 'date'
27
+ require 'json'
28
+ require 'logger'
29
+ require 'tempfile'
30
+ require 'uri'
31
+ require 'faraday'
32
+ require 'mimemagic'
33
+ require_relative 'version'
34
+ require_relative 'api_error'
35
+
36
+ module AsposeCadCloud
37
+ #
38
+ # api client is mainly responsible for making the HTTP call to the API backend.
39
+ #
40
+ class ApiClient
41
+ # The Configuration object holding settings to be used in the API client.
42
+ attr_accessor :config
43
+
44
+ # Defines the headers to be used in HTTP requests of all API calls by default.
45
+ #
46
+ # @return [Hash]
47
+ attr_accessor :default_headers
48
+
49
+ # Initializes the ApiClient
50
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
51
+ def initialize(config = Configuration.default)
52
+ @config = config
53
+ @default_headers = {
54
+ 'Content-Type' => "application/json",
55
+ 'x-aspose-client' => "ruby sdk",
56
+ 'x-aspose-version' => AsposeCadCloud::VERSION.to_s
57
+ }
58
+ end
59
+
60
+ def self.default
61
+ @@default ||= ApiClient.new
62
+ end
63
+
64
+ # Call an API with given options.
65
+ #
66
+ # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
67
+ # the data deserialized from response body (could be nil), response status code and response headers.
68
+ def call_api(http_method, path, opts = {})
69
+ response = build_request(http_method, path, opts)
70
+ download_file response if opts[:return_type] == 'File'
71
+ if @config.debugging
72
+ @config.logger.debug "'HTTP' response body '~BEGIN~'\n #{response.body}\n'~END~'\n"
73
+ end
74
+
75
+ unless response.success?
76
+ if response.status == 0
77
+ # Errors from libcurl will be made visible here
78
+ raise ApiError.new(:code => 0,
79
+ :message => response.reason_phrase)
80
+ else
81
+ raise ApiError.new(:code => response.status,
82
+ :response_headers => response.headers,
83
+ :response_body => response.body),
84
+ response.reason_phrase
85
+ end
86
+ end
87
+
88
+
89
+ data = deserialize(response, opts[:return_type]) if opts[:return_type]
90
+ [data, response.status, response.headers]
91
+ end
92
+
93
+ # Builds the HTTP request
94
+ #
95
+ # @param [String] http_method HTTP method/verb (e.g. POST)
96
+ # @param [String] path URL path (e.g. /account/new)
97
+ # @option opts [Hash] :header_params Header parameters
98
+ # @option opts [Hash] :query_params Query parameters
99
+ # @option opts [Hash] :form_params Query parameters
100
+ # @option opts [Object] :body HTTP body (JSON/XML)
101
+ # @return [Faraday::Response] A Faraday Response
102
+ def build_request(http_method, path, opts = {})
103
+ url = build_request_url(path)
104
+ http_method = http_method.to_sym.downcase
105
+
106
+ header_params = @default_headers.merge(opts[:header_params] || {})
107
+ query_params = opts[:query_params] || {}
108
+ form_params = opts[:form_params] || {}
109
+ body = opts[:body] if opts[:body] || nil?
110
+
111
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
112
+
113
+ req_opts = {
114
+ :method => http_method,
115
+ :headers => header_params,
116
+ :params => query_params,
117
+ :body => body
118
+ }
119
+
120
+ if [:post, :patch, :put, :delete].include?(http_method)
121
+ req_body = build_request_body(header_params, form_params, opts[:body])
122
+ req_opts.update :body => req_body
123
+ if @config.debugging
124
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
125
+ end
126
+ end
127
+
128
+ conn = Faraday.new url, { :params => query_params, :headers => header_params } do |f|
129
+ f.request :multipart
130
+ f.request :url_encoded
131
+ f.adapter Faraday.default_adapter
132
+ end
133
+
134
+ case http_method
135
+ when :post
136
+ return conn.post url, req_opts[:body]
137
+ when :put
138
+ return conn.put url, req_opts[:body]
139
+ when :get
140
+ return conn.get url, req_opts[:body]
141
+ else
142
+ return conn.delete url do |c|
143
+ c.body = req_opts[:body]
144
+ end
145
+ end
146
+ end
147
+
148
+ # Check if the given MIME is a JSON MIME.
149
+ # JSON MIME examples:
150
+ # application/json
151
+ # application/json; charset=UTF8
152
+ # APPLICATION/JSON
153
+ # */*
154
+ # @param [String] mime MIME
155
+ # @return [Boolean] True if the MIME is application/json
156
+ def json_mime?(mime)
157
+ (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
158
+ end
159
+
160
+ # Deserialize the response to the given return type.
161
+ #
162
+ # @param [Response] response HTTP response
163
+ # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
164
+ def deserialize(response, return_type)
165
+ body = response.body
166
+
167
+ # handle file downloading - return the File instance processed in request callbacks
168
+ # note that response body is empty when the file is written in chunks in request on_body callback
169
+ return @tempfile if return_type == 'File'
170
+
171
+ return nil if body.nil? || body.empty?
172
+
173
+ # return response body directly for String return type
174
+ return body if return_type == 'String'
175
+
176
+ # ensuring a default content type
177
+ content_type = response.headers['Content-Type'] || 'application/json'
178
+
179
+ raise "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
180
+
181
+ begin
182
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
183
+ rescue JSON::ParserError => e
184
+ if %w[String Date DateTime].include?(return_type)
185
+ data = body
186
+ else
187
+ raise e
188
+ end
189
+ end
190
+
191
+ convert_to_type data, return_type
192
+ end
193
+
194
+ # Convert data to the given return type.
195
+ # @param [Object] data Data to be converted
196
+ # @param [String] return_type Return type
197
+ # @return [Mixed] Data in a particular type
198
+ def convert_to_type(data, return_type)
199
+ return nil if data.nil?
200
+ case return_type
201
+ when 'String'
202
+ data.to_s
203
+ when 'Integer'
204
+ data.to_i
205
+ when 'Float'
206
+ data.to_f
207
+ when 'BOOLEAN'
208
+ data == true
209
+ when 'DateTime'
210
+ # parse date time (expecting ISO 8601 format)
211
+ DateTime.parse data
212
+ when 'Date'
213
+ # parse date time (expecting ISO 8601 format)
214
+ Date.parse data
215
+ when 'Object'
216
+ # generic object (usually a Hash), return directly
217
+ data
218
+ when /\AArray<(.+)>\z/
219
+ # e.g. Array<Pet>
220
+ sub_type = $1
221
+ data.map {|item| convert_to_type(item, sub_type) }
222
+ when /\AHash\<String, (.+)\>\z/
223
+ # e.g. Hash<String, Integer>
224
+ sub_type = $1
225
+ {}.tap do |hash|
226
+ data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
227
+ end
228
+ else
229
+ # models, e.g. Pet
230
+ AsposeCadCloud.const_get(return_type).new.tap do |model|
231
+ model.build_from_hash data
232
+ end
233
+ end
234
+ end
235
+
236
+ # Save response body into a file in (the defined) temporary folder, using the filename
237
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
238
+ # The response body is written to the file in chunks in order to handle files which
239
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
240
+ # process can use.
241
+ #
242
+ # @see Configuration#temp_folder_path
243
+ def download_file(response)
244
+ tempfile = nil
245
+ encoding = nil
246
+ content_disposition = response.headers['Content-Disposition']
247
+ if content_disposition and content_disposition =~ /filename=/i
248
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
249
+ prefix = sanitize_filename(filename)
250
+ else
251
+ prefix = 'download-'
252
+ end
253
+ prefix += '-' unless prefix.end_with?('-')
254
+ encoding = response.body.encoding
255
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
256
+ @tempfile = tempfile
257
+ tempfile.write(response.body)
258
+ response.on_complete do |resp|
259
+ tempfile.close
260
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
261
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
262
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
263
+ "explicitly with `tempfile.delete`"
264
+ end
265
+ end
266
+
267
+ # Sanitize filename by removing path.
268
+ # e.g. ../../sun.gif becomes sun.gif
269
+ #
270
+ # @param [String] filename the filename to be sanitized
271
+ # @return [String] the sanitized filename
272
+ def sanitize_filename(filename)
273
+ filename.gsub(/.*[\/\\]/, '')
274
+ end
275
+
276
+ def build_request_url(path)
277
+ # Add leading and trailing slashes to path
278
+ path = "/#{path}".gsub(/\/+/, '/')
279
+ URI.encode(@config.base_url + path)
280
+ end
281
+
282
+ # Builds the HTTP request body
283
+ #
284
+ # @param [Hash] header_params Header parameters
285
+ # @param [Hash] form_params Query parameters
286
+ # @param [Object] body HTTP body (JSON/XML)
287
+ # @return [String] HTTP body data in the form of string
288
+ def build_request_body(header_params, form_params, body)
289
+ # http form
290
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
291
+ header_params['Content-Type'] == 'multipart/form-data'
292
+ data = {}
293
+ form_params.each do |key, value|
294
+ case value
295
+ when ::File
296
+ data[key] = Faraday::UploadIO.new(value.path, MimeMagic.by_magic(value).to_s, key)
297
+ when ::Array, nil
298
+ data[key] = value
299
+ else
300
+ data[key] = value.to_s
301
+ end
302
+ end
303
+ elsif body
304
+ data = body.is_a?(String) ? body : body.to_json
305
+ else
306
+ data = nil
307
+ end
308
+ data
309
+ end
310
+
311
+ # Update hearder and query params based on authentication settings.
312
+ #
313
+ # @param [Hash] header_params Header parameters
314
+ # @param [Hash] query_params Query parameters
315
+ # @param [String] auth_names Authentication scheme name
316
+ def update_params_for_auth!(header_params, query_params, auth_names)
317
+ Array(auth_names).each do |auth_name|
318
+ auth_setting = @config.auth_settings[auth_name]
319
+ next unless auth_setting
320
+ case auth_setting[:in]
321
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
322
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
323
+ else raise ArgumentError, 'Authentication token must be in `query` of `header`'
324
+ end
325
+ end
326
+ end
327
+
328
+ # Sets user agent in HTTP header
329
+ #
330
+ # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
331
+ def user_agent=(user_agent)
332
+ @user_agent = user_agent
333
+ @default_headers['User-Agent'] = @user_agent
334
+ end
335
+
336
+ # Return Accept header based on an array of accepts provided.
337
+ # @param [Array] accepts array for Accept
338
+ # @return [String] the Accept header (e.g. application/json)
339
+ def select_header_accept(accepts)
340
+ return nil if accepts.nil? || accepts.empty?
341
+ # use JSON when present, otherwise use all of the provided
342
+ json_accept = accepts.find { |s| json_mime?(s) }
343
+ return json_accept || accepts.join(',')
344
+ end
345
+
346
+ # Return Content-Type header based on an array of content types provided.
347
+ # @param [Array] content_types array for Content-Type
348
+ # @return [String] the Content-Type header (e.g. application/json)
349
+ def select_header_content_type(content_types)
350
+ # use application/json by default
351
+ return 'application/json' if content_types.nil? || content_types.empty?
352
+ # use JSON when present, otherwise use the first one
353
+ json_content_type = content_types.find { |s| json_mime?(s) }
354
+ return json_content_type || content_types.first
355
+ end
356
+
357
+ # Convert object (array, hash, object, etc) to JSON string.
358
+ # @param [Object] model object to be converted into JSON string
359
+ # @return [String] JSON string representation of the object
360
+ def object_to_http_body(model)
361
+ return '"' + model + '"' if model.is_a?(String)
362
+ return model if model.nil?
363
+ local_body = nil
364
+ if model.is_a?(Array)
365
+ local_body = model.map { |m| object_to_hash(m) }
366
+ else
367
+ local_body = object_to_hash(model)
368
+ end
369
+ local_body.to_json
370
+ end
371
+
372
+ # Convert object(non-array) to hash.
373
+ # @param [Object] obj object to be converted into JSON string
374
+ # @return [String] JSON string representation of the object
375
+ def object_to_hash(obj)
376
+ if obj.respond_to?(:to_hash)
377
+ obj.to_hash
378
+ else
379
+ obj
380
+ end
381
+ end
382
+
383
+ # Build parameter value according to the given collection format.
384
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
385
+ def build_collection_param(param, collection_format)
386
+ case collection_format
387
+ when :csv
388
+ param.join(',')
389
+ when :ssv
390
+ param.join(' ')
391
+ when :tsv
392
+ param.join("\t")
393
+ when :pipes
394
+ param.join('|')
395
+ when :multi
396
+ # return the array directly as faraday will handle it as expected
397
+ param
398
+ else
399
+ raise "unknown collection format: #{collection_format.inspect}"
400
+ end
401
+ end
402
+ end
403
+ end
@@ -0,0 +1,54 @@
1
+ # -----------------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="api_error.rb">
3
+ # Copyright (c) 2018 Aspose.CAD Cloud
4
+ # </copyright>
5
+ # <summary>
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ # SOFTWARE.
23
+ # </summary>
24
+ # -----------------------------------------------------------------------------------
25
+
26
+ module AsposeCadCloud
27
+ #
28
+ # ApiError class for error handling
29
+ #
30
+ class ApiError < StandardError
31
+ attr_reader :code, :response_headers, :response_body
32
+
33
+ # Usage examples:
34
+ # ApiError.new
35
+ # ApiError.new("message")
36
+ # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
37
+ # ApiError.new(:code => 404, :message => "Not Found")
38
+ def initialize(arg = nil)
39
+ if arg.is_a? Hash
40
+ if arg.key?(:message) || arg.key?('message')
41
+ super(arg[:message] || arg['message'])
42
+ else
43
+ super arg
44
+ end
45
+
46
+ arg.each do |k, v|
47
+ instance_variable_set "@#{k}", v
48
+ end
49
+ else
50
+ super arg
51
+ end
52
+ end
53
+ end
54
+ end