File tree Expand file tree Collapse file tree 35 files changed +399
-3
lines changed
modules/openapi-generator/src/main/resources/ruby-client
ruby-faraday/lib/openapi_client/models
ruby-httpx/lib/openapi_client/models
ruby-typhoeus/lib/openapi_client/models
ruby-autoload/lib/petstore/models Expand file tree Collapse file tree 35 files changed +399
-3
lines changed Original file line number Diff line number Diff line change 350
350
@{ {{name} }} = { {{name} }}
351
351
end
352
352
353
+ { {/hasValidation} }
354
+ { {^hasValidation} }
355
+ { {^isNullable} }
356
+ { {#required} }
357
+ # Custom attribute writer method with validation
358
+ # @param [Object] { {{name} }} Value to be assigned
359
+ def { {{name} }}=({ {{name} }})
360
+ if { {{name} }}.nil?
361
+ fail ArgumentError, '{ {{name} }} cannot be nil'
362
+ end
363
+
364
+ @{ {{name} }} = { {{name} }}
365
+ end
366
+
367
+ { {/required} }
368
+ { {/isNullable} }
353
369
{ {/hasValidation} }
354
370
{ {/isEnum} }
355
371
{ {/vars} }
Original file line number Diff line number Diff line change @@ -160,6 +160,26 @@ def valid?
160
160
true
161
161
end
162
162
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] name Value to be assigned
165
+ def name = ( name )
166
+ if name . nil?
167
+ fail ArgumentError , 'name cannot be nil'
168
+ end
169
+
170
+ @name = name
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] photo_urls Value to be assigned
175
+ def photo_urls = ( photo_urls )
176
+ if photo_urls . nil?
177
+ fail ArgumentError , 'photo_urls cannot be nil'
178
+ end
179
+
180
+ @photo_urls = photo_urls
181
+ end
182
+
163
183
# Custom attribute writer method checking allowed values (enum).
164
184
# @param [Object] status Object to be assigned
165
185
def status = ( status )
Original file line number Diff line number Diff line change @@ -160,6 +160,26 @@ def valid?
160
160
true
161
161
end
162
162
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] name Value to be assigned
165
+ def name = ( name )
166
+ if name . nil?
167
+ fail ArgumentError , 'name cannot be nil'
168
+ end
169
+
170
+ @name = name
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] photo_urls Value to be assigned
175
+ def photo_urls = ( photo_urls )
176
+ if photo_urls . nil?
177
+ fail ArgumentError , 'photo_urls cannot be nil'
178
+ end
179
+
180
+ @photo_urls = photo_urls
181
+ end
182
+
163
183
# Custom attribute writer method checking allowed values (enum).
164
184
# @param [Object] status Object to be assigned
165
185
def status = ( status )
Original file line number Diff line number Diff line change @@ -160,6 +160,26 @@ def valid?
160
160
true
161
161
end
162
162
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] name Value to be assigned
165
+ def name = ( name )
166
+ if name . nil?
167
+ fail ArgumentError , 'name cannot be nil'
168
+ end
169
+
170
+ @name = name
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] photo_urls Value to be assigned
175
+ def photo_urls = ( photo_urls )
176
+ if photo_urls . nil?
177
+ fail ArgumentError , 'photo_urls cannot be nil'
178
+ end
179
+
180
+ @photo_urls = photo_urls
181
+ end
182
+
163
183
# Custom attribute writer method checking allowed values (enum).
164
184
# @param [Object] status Object to be assigned
165
185
def status = ( status )
Original file line number Diff line number Diff line change @@ -99,6 +99,16 @@ def valid?
99
99
true
100
100
end
101
101
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] class_name Value to be assigned
104
+ def class_name = ( class_name )
105
+ if class_name . nil?
106
+ fail ArgumentError , 'class_name cannot be nil'
107
+ end
108
+
109
+ @class_name = class_name
110
+ end
111
+
102
112
# Checks equality by comparing each attribute.
103
113
# @param [Object] Object to be compared
104
114
def ==( o )
Original file line number Diff line number Diff line change @@ -92,6 +92,16 @@ def valid?
92
92
true
93
93
end
94
94
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] name Value to be assigned
97
+ def name = ( name )
98
+ if name . nil?
99
+ fail ArgumentError , 'name cannot be nil'
100
+ end
101
+
102
+ @name = name
103
+ end
104
+
95
105
# Checks equality by comparing each attribute.
96
106
# @param [Object] Object to be compared
97
107
def ==( o )
Original file line number Diff line number Diff line change @@ -410,6 +410,26 @@ def string=(string)
410
410
@string = string
411
411
end
412
412
413
+ # Custom attribute writer method with validation
414
+ # @param [Object] byte Value to be assigned
415
+ def byte = ( byte )
416
+ if byte . nil?
417
+ fail ArgumentError , 'byte cannot be nil'
418
+ end
419
+
420
+ @byte = byte
421
+ end
422
+
423
+ # Custom attribute writer method with validation
424
+ # @param [Object] date Value to be assigned
425
+ def date = ( date )
426
+ if date . nil?
427
+ fail ArgumentError , 'date cannot be nil'
428
+ end
429
+
430
+ @date = date
431
+ end
432
+
413
433
# Custom attribute writer method with validation
414
434
# @param [Object] password Value to be assigned
415
435
def password = ( password )
Original file line number Diff line number Diff line change @@ -109,6 +109,16 @@ def valid?
109
109
true
110
110
end
111
111
112
+ # Custom attribute writer method with validation
113
+ # @param [Object] name Value to be assigned
114
+ def name = ( name )
115
+ if name . nil?
116
+ fail ArgumentError , 'name cannot be nil'
117
+ end
118
+
119
+ @name = name
120
+ end
121
+
112
122
# Checks equality by comparing each attribute.
113
123
# @param [Object] Object to be compared
114
124
def ==( o )
Original file line number Diff line number Diff line change @@ -106,6 +106,16 @@ def valid?
106
106
true
107
107
end
108
108
109
+ # Custom attribute writer method with validation
110
+ # @param [Object] value Value to be assigned
111
+ def value = ( value )
112
+ if value . nil?
113
+ fail ArgumentError , 'value cannot be nil'
114
+ end
115
+
116
+ @value = value
117
+ end
118
+
109
119
# Checks equality by comparing each attribute.
110
120
# @param [Object] Object to be compared
111
121
def ==( o )
Original file line number Diff line number Diff line change @@ -160,6 +160,16 @@ def valid?
160
160
true
161
161
end
162
162
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] name Value to be assigned
165
+ def name = ( name )
166
+ if name . nil?
167
+ fail ArgumentError , 'name cannot be nil'
168
+ end
169
+
170
+ @name = name
171
+ end
172
+
163
173
# Custom attribute writer method with validation
164
174
# @param [Object] photo_urls Value to be assigned
165
175
def photo_urls = ( photo_urls )
Original file line number Diff line number Diff line change @@ -99,6 +99,16 @@ def valid?
99
99
true
100
100
end
101
101
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] class_name Value to be assigned
104
+ def class_name = ( class_name )
105
+ if class_name . nil?
106
+ fail ArgumentError , 'class_name cannot be nil'
107
+ end
108
+
109
+ @class_name = class_name
110
+ end
111
+
102
112
# Checks equality by comparing each attribute.
103
113
# @param [Object] Object to be compared
104
114
def ==( o )
Original file line number Diff line number Diff line change @@ -92,6 +92,16 @@ def valid?
92
92
true
93
93
end
94
94
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] name Value to be assigned
97
+ def name = ( name )
98
+ if name . nil?
99
+ fail ArgumentError , 'name cannot be nil'
100
+ end
101
+
102
+ @name = name
103
+ end
104
+
95
105
# Checks equality by comparing each attribute.
96
106
# @param [Object] Object to be compared
97
107
def ==( o )
Original file line number Diff line number Diff line change @@ -410,6 +410,26 @@ def string=(string)
410
410
@string = string
411
411
end
412
412
413
+ # Custom attribute writer method with validation
414
+ # @param [Object] byte Value to be assigned
415
+ def byte = ( byte )
416
+ if byte . nil?
417
+ fail ArgumentError , 'byte cannot be nil'
418
+ end
419
+
420
+ @byte = byte
421
+ end
422
+
423
+ # Custom attribute writer method with validation
424
+ # @param [Object] date Value to be assigned
425
+ def date = ( date )
426
+ if date . nil?
427
+ fail ArgumentError , 'date cannot be nil'
428
+ end
429
+
430
+ @date = date
431
+ end
432
+
413
433
# Custom attribute writer method with validation
414
434
# @param [Object] password Value to be assigned
415
435
def password = ( password )
Original file line number Diff line number Diff line change @@ -109,6 +109,16 @@ def valid?
109
109
true
110
110
end
111
111
112
+ # Custom attribute writer method with validation
113
+ # @param [Object] name Value to be assigned
114
+ def name = ( name )
115
+ if name . nil?
116
+ fail ArgumentError , 'name cannot be nil'
117
+ end
118
+
119
+ @name = name
120
+ end
121
+
112
122
# Checks equality by comparing each attribute.
113
123
# @param [Object] Object to be compared
114
124
def ==( o )
Original file line number Diff line number Diff line change @@ -106,6 +106,16 @@ def valid?
106
106
true
107
107
end
108
108
109
+ # Custom attribute writer method with validation
110
+ # @param [Object] value Value to be assigned
111
+ def value = ( value )
112
+ if value . nil?
113
+ fail ArgumentError , 'value cannot be nil'
114
+ end
115
+
116
+ @value = value
117
+ end
118
+
109
119
# Checks equality by comparing each attribute.
110
120
# @param [Object] Object to be compared
111
121
def ==( o )
Original file line number Diff line number Diff line change @@ -160,6 +160,16 @@ def valid?
160
160
true
161
161
end
162
162
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] name Value to be assigned
165
+ def name = ( name )
166
+ if name . nil?
167
+ fail ArgumentError , 'name cannot be nil'
168
+ end
169
+
170
+ @name = name
171
+ end
172
+
163
173
# Custom attribute writer method with validation
164
174
# @param [Object] photo_urls Value to be assigned
165
175
def photo_urls = ( photo_urls )
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ def initialize(attributes = {})
94
94
95
95
describe 'BaseObject' do
96
96
describe 'boolean values' do
97
- let ( :obj ) { Petstore ::Cat . new ( declawed : false ) }
97
+ let ( :obj ) { Petstore ::Cat . new ( class_name : "CAT" , declawed : false ) }
98
98
99
99
it 'should have values set' do
100
100
expect ( obj . declawed ) . not_to be_nil
Original file line number Diff line number Diff line change @@ -99,6 +99,16 @@ def valid?
99
99
true
100
100
end
101
101
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] class_name Value to be assigned
104
+ def class_name = ( class_name )
105
+ if class_name . nil?
106
+ fail ArgumentError , 'class_name cannot be nil'
107
+ end
108
+
109
+ @class_name = class_name
110
+ end
111
+
102
112
# Checks equality by comparing each attribute.
103
113
# @param [Object] Object to be compared
104
114
def ==( o )
Original file line number Diff line number Diff line change @@ -92,6 +92,16 @@ def valid?
92
92
true
93
93
end
94
94
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] name Value to be assigned
97
+ def name = ( name )
98
+ if name . nil?
99
+ fail ArgumentError , 'name cannot be nil'
100
+ end
101
+
102
+ @name = name
103
+ end
104
+
95
105
# Checks equality by comparing each attribute.
96
106
# @param [Object] Object to be compared
97
107
def ==( o )
Original file line number Diff line number Diff line change @@ -410,6 +410,26 @@ def string=(string)
410
410
@string = string
411
411
end
412
412
413
+ # Custom attribute writer method with validation
414
+ # @param [Object] byte Value to be assigned
415
+ def byte = ( byte )
416
+ if byte . nil?
417
+ fail ArgumentError , 'byte cannot be nil'
418
+ end
419
+
420
+ @byte = byte
421
+ end
422
+
423
+ # Custom attribute writer method with validation
424
+ # @param [Object] date Value to be assigned
425
+ def date = ( date )
426
+ if date . nil?
427
+ fail ArgumentError , 'date cannot be nil'
428
+ end
429
+
430
+ @date = date
431
+ end
432
+
413
433
# Custom attribute writer method with validation
414
434
# @param [Object] password Value to be assigned
415
435
def password = ( password )
You can’t perform that action at this time.
0 commit comments