Class: Forgejo::PullRequest
- Inherits:
-
Object
- Object
- Forgejo::PullRequest
- Defined in:
- lib/forgejo/models/pull_request.rb
Overview
PullRequest represents a pull request
Instance Attribute Summary collapse
-
#additions ⇒ Object
Returns the value of attribute additions.
-
#allow_maintainer_edit ⇒ Object
Returns the value of attribute allow_maintainer_edit.
-
#assignee ⇒ Object
Returns the value of attribute assignee.
-
#assignees ⇒ Object
Returns the value of attribute assignees.
-
#base ⇒ Object
Returns the value of attribute base.
-
#body ⇒ Object
Returns the value of attribute body.
-
#changed_files ⇒ Object
Returns the value of attribute changed_files.
-
#closed_at ⇒ Object
Returns the value of attribute closed_at.
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#deletions ⇒ Object
Returns the value of attribute deletions.
-
#diff_url ⇒ Object
Returns the value of attribute diff_url.
-
#draft ⇒ Object
Returns the value of attribute draft.
-
#due_date ⇒ Object
Returns the value of attribute due_date.
-
#head ⇒ Object
Returns the value of attribute head.
-
#html_url ⇒ Object
Returns the value of attribute html_url.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_locked ⇒ Object
Returns the value of attribute is_locked.
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#merge_base ⇒ Object
Returns the value of attribute merge_base.
-
#merge_commit_sha ⇒ Object
Returns the value of attribute merge_commit_sha.
-
#mergeable ⇒ Object
Returns the value of attribute mergeable.
-
#merged ⇒ Object
Returns the value of attribute merged.
-
#merged_at ⇒ Object
Returns the value of attribute merged_at.
-
#merged_by ⇒ Object
Returns the value of attribute merged_by.
-
#milestone ⇒ Object
Returns the value of attribute milestone.
-
#number ⇒ Object
Returns the value of attribute number.
-
#patch_url ⇒ Object
Returns the value of attribute patch_url.
-
#pin_order ⇒ Object
Returns the value of attribute pin_order.
-
#requested_reviewers ⇒ Object
Returns the value of attribute requested_reviewers.
-
#requested_reviewers_teams ⇒ Object
Returns the value of attribute requested_reviewers_teams.
-
#review_comments ⇒ Object
number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR).
-
#state ⇒ Object
StateType issue state type.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#url ⇒ Object
Returns the value of attribute url.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PullRequest
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ PullRequest
Initializes the object
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File 'lib/forgejo/models/pull_request.rb', line 199 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Forgejo::PullRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Forgejo::PullRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'additions') self.additions = attributes[:'additions'] end if attributes.key?(:'allow_maintainer_edit') self.allow_maintainer_edit = attributes[:'allow_maintainer_edit'] end if attributes.key?(:'assignee') self.assignee = attributes[:'assignee'] end if attributes.key?(:'assignees') if (value = attributes[:'assignees']).is_a?(Array) self.assignees = value end end if attributes.key?(:'base') self.base = attributes[:'base'] end if attributes.key?(:'body') self.body = attributes[:'body'] end if attributes.key?(:'changed_files') self.changed_files = attributes[:'changed_files'] end if attributes.key?(:'closed_at') self.closed_at = attributes[:'closed_at'] end if attributes.key?(:'comments') self.comments = attributes[:'comments'] end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.key?(:'deletions') self.deletions = attributes[:'deletions'] end if attributes.key?(:'diff_url') self.diff_url = attributes[:'diff_url'] end if attributes.key?(:'draft') self.draft = attributes[:'draft'] end if attributes.key?(:'due_date') self.due_date = attributes[:'due_date'] end if attributes.key?(:'head') self.head = attributes[:'head'] end if attributes.key?(:'html_url') self.html_url = attributes[:'html_url'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'is_locked') self.is_locked = attributes[:'is_locked'] end if attributes.key?(:'labels') if (value = attributes[:'labels']).is_a?(Array) self.labels = value end end if attributes.key?(:'merge_base') self.merge_base = attributes[:'merge_base'] end if attributes.key?(:'merge_commit_sha') self.merge_commit_sha = attributes[:'merge_commit_sha'] end if attributes.key?(:'mergeable') self.mergeable = attributes[:'mergeable'] end if attributes.key?(:'merged') self.merged = attributes[:'merged'] end if attributes.key?(:'merged_at') self.merged_at = attributes[:'merged_at'] end if attributes.key?(:'merged_by') self.merged_by = attributes[:'merged_by'] end if attributes.key?(:'milestone') self.milestone = attributes[:'milestone'] end if attributes.key?(:'number') self.number = attributes[:'number'] end if attributes.key?(:'patch_url') self.patch_url = attributes[:'patch_url'] end if attributes.key?(:'pin_order') self.pin_order = attributes[:'pin_order'] end if attributes.key?(:'requested_reviewers') if (value = attributes[:'requested_reviewers']).is_a?(Array) self.requested_reviewers = value end end if attributes.key?(:'requested_reviewers_teams') if (value = attributes[:'requested_reviewers_teams']).is_a?(Array) self.requested_reviewers_teams = value end end if attributes.key?(:'review_comments') self.review_comments = attributes[:'review_comments'] end if attributes.key?(:'state') self.state = attributes[:'state'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] end if attributes.key?(:'url') self.url = attributes[:'url'] end if attributes.key?(:'user') self.user = attributes[:'user'] end end |
Instance Attribute Details
#additions ⇒ Object
Returns the value of attribute additions.
19 20 21 |
# File 'lib/forgejo/models/pull_request.rb', line 19 def additions @additions end |
#allow_maintainer_edit ⇒ Object
Returns the value of attribute allow_maintainer_edit.
21 22 23 |
# File 'lib/forgejo/models/pull_request.rb', line 21 def allow_maintainer_edit @allow_maintainer_edit end |
#assignee ⇒ Object
Returns the value of attribute assignee.
23 24 25 |
# File 'lib/forgejo/models/pull_request.rb', line 23 def assignee @assignee end |
#assignees ⇒ Object
Returns the value of attribute assignees.
25 26 27 |
# File 'lib/forgejo/models/pull_request.rb', line 25 def assignees @assignees end |
#base ⇒ Object
Returns the value of attribute base.
27 28 29 |
# File 'lib/forgejo/models/pull_request.rb', line 27 def base @base end |
#body ⇒ Object
Returns the value of attribute body.
29 30 31 |
# File 'lib/forgejo/models/pull_request.rb', line 29 def body @body end |
#changed_files ⇒ Object
Returns the value of attribute changed_files.
31 32 33 |
# File 'lib/forgejo/models/pull_request.rb', line 31 def changed_files @changed_files end |
#closed_at ⇒ Object
Returns the value of attribute closed_at.
33 34 35 |
# File 'lib/forgejo/models/pull_request.rb', line 33 def closed_at @closed_at end |
#comments ⇒ Object
Returns the value of attribute comments.
35 36 37 |
# File 'lib/forgejo/models/pull_request.rb', line 35 def comments @comments end |
#created_at ⇒ Object
Returns the value of attribute created_at.
37 38 39 |
# File 'lib/forgejo/models/pull_request.rb', line 37 def created_at @created_at end |
#deletions ⇒ Object
Returns the value of attribute deletions.
39 40 41 |
# File 'lib/forgejo/models/pull_request.rb', line 39 def deletions @deletions end |
#diff_url ⇒ Object
Returns the value of attribute diff_url.
41 42 43 |
# File 'lib/forgejo/models/pull_request.rb', line 41 def diff_url @diff_url end |
#draft ⇒ Object
Returns the value of attribute draft.
43 44 45 |
# File 'lib/forgejo/models/pull_request.rb', line 43 def draft @draft end |
#due_date ⇒ Object
Returns the value of attribute due_date.
45 46 47 |
# File 'lib/forgejo/models/pull_request.rb', line 45 def due_date @due_date end |
#head ⇒ Object
Returns the value of attribute head.
47 48 49 |
# File 'lib/forgejo/models/pull_request.rb', line 47 def head @head end |
#html_url ⇒ Object
Returns the value of attribute html_url.
49 50 51 |
# File 'lib/forgejo/models/pull_request.rb', line 49 def html_url @html_url end |
#id ⇒ Object
Returns the value of attribute id.
51 52 53 |
# File 'lib/forgejo/models/pull_request.rb', line 51 def id @id end |
#is_locked ⇒ Object
Returns the value of attribute is_locked.
53 54 55 |
# File 'lib/forgejo/models/pull_request.rb', line 53 def is_locked @is_locked end |
#labels ⇒ Object
Returns the value of attribute labels.
55 56 57 |
# File 'lib/forgejo/models/pull_request.rb', line 55 def labels @labels end |
#merge_base ⇒ Object
Returns the value of attribute merge_base.
57 58 59 |
# File 'lib/forgejo/models/pull_request.rb', line 57 def merge_base @merge_base end |
#merge_commit_sha ⇒ Object
Returns the value of attribute merge_commit_sha.
59 60 61 |
# File 'lib/forgejo/models/pull_request.rb', line 59 def merge_commit_sha @merge_commit_sha end |
#mergeable ⇒ Object
Returns the value of attribute mergeable.
61 62 63 |
# File 'lib/forgejo/models/pull_request.rb', line 61 def mergeable @mergeable end |
#merged ⇒ Object
Returns the value of attribute merged.
63 64 65 |
# File 'lib/forgejo/models/pull_request.rb', line 63 def merged @merged end |
#merged_at ⇒ Object
Returns the value of attribute merged_at.
65 66 67 |
# File 'lib/forgejo/models/pull_request.rb', line 65 def merged_at @merged_at end |
#merged_by ⇒ Object
Returns the value of attribute merged_by.
67 68 69 |
# File 'lib/forgejo/models/pull_request.rb', line 67 def merged_by @merged_by end |
#milestone ⇒ Object
Returns the value of attribute milestone.
69 70 71 |
# File 'lib/forgejo/models/pull_request.rb', line 69 def milestone @milestone end |
#number ⇒ Object
Returns the value of attribute number.
71 72 73 |
# File 'lib/forgejo/models/pull_request.rb', line 71 def number @number end |
#patch_url ⇒ Object
Returns the value of attribute patch_url.
73 74 75 |
# File 'lib/forgejo/models/pull_request.rb', line 73 def patch_url @patch_url end |
#pin_order ⇒ Object
Returns the value of attribute pin_order.
75 76 77 |
# File 'lib/forgejo/models/pull_request.rb', line 75 def pin_order @pin_order end |
#requested_reviewers ⇒ Object
Returns the value of attribute requested_reviewers.
77 78 79 |
# File 'lib/forgejo/models/pull_request.rb', line 77 def requested_reviewers @requested_reviewers end |
#requested_reviewers_teams ⇒ Object
Returns the value of attribute requested_reviewers_teams.
79 80 81 |
# File 'lib/forgejo/models/pull_request.rb', line 79 def requested_reviewers_teams @requested_reviewers_teams end |
#review_comments ⇒ Object
number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR)
82 83 84 |
# File 'lib/forgejo/models/pull_request.rb', line 82 def review_comments @review_comments end |
#state ⇒ Object
StateType issue state type
85 86 87 |
# File 'lib/forgejo/models/pull_request.rb', line 85 def state @state end |
#title ⇒ Object
Returns the value of attribute title.
87 88 89 |
# File 'lib/forgejo/models/pull_request.rb', line 87 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
89 90 91 |
# File 'lib/forgejo/models/pull_request.rb', line 89 def updated_at @updated_at end |
#url ⇒ Object
Returns the value of attribute url.
91 92 93 |
# File 'lib/forgejo/models/pull_request.rb', line 91 def url @url end |
#user ⇒ Object
Returns the value of attribute user.
93 94 95 |
# File 'lib/forgejo/models/pull_request.rb', line 93 def user @user end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 |
# File 'lib/forgejo/models/pull_request.rb', line 468 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Forgejo.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
139 140 141 |
# File 'lib/forgejo/models/pull_request.rb', line 139 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
144 145 146 |
# File 'lib/forgejo/models/pull_request.rb', line 144 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/forgejo/models/pull_request.rb', line 96 def self.attribute_map { :'additions' => :'additions', :'allow_maintainer_edit' => :'allow_maintainer_edit', :'assignee' => :'assignee', :'assignees' => :'assignees', :'base' => :'base', :'body' => :'body', :'changed_files' => :'changed_files', :'closed_at' => :'closed_at', :'comments' => :'comments', :'created_at' => :'created_at', :'deletions' => :'deletions', :'diff_url' => :'diff_url', :'draft' => :'draft', :'due_date' => :'due_date', :'head' => :'head', :'html_url' => :'html_url', :'id' => :'id', :'is_locked' => :'is_locked', :'labels' => :'labels', :'merge_base' => :'merge_base', :'merge_commit_sha' => :'merge_commit_sha', :'mergeable' => :'mergeable', :'merged' => :'merged', :'merged_at' => :'merged_at', :'merged_by' => :'merged_by', :'milestone' => :'milestone', :'number' => :'number', :'patch_url' => :'patch_url', :'pin_order' => :'pin_order', :'requested_reviewers' => :'requested_reviewers', :'requested_reviewers_teams' => :'requested_reviewers_teams', :'review_comments' => :'review_comments', :'state' => :'state', :'title' => :'title', :'updated_at' => :'updated_at', :'url' => :'url', :'user' => :'user' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 |
# File 'lib/forgejo/models/pull_request.rb', line 444 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
192 193 194 195 |
# File 'lib/forgejo/models/pull_request.rb', line 192 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/forgejo/models/pull_request.rb', line 149 def self.openapi_types { :'additions' => :'Integer', :'allow_maintainer_edit' => :'Boolean', :'assignee' => :'User', :'assignees' => :'Array<User>', :'base' => :'PRBranchInfo', :'body' => :'String', :'changed_files' => :'Integer', :'closed_at' => :'Time', :'comments' => :'Integer', :'created_at' => :'Time', :'deletions' => :'Integer', :'diff_url' => :'String', :'draft' => :'Boolean', :'due_date' => :'Time', :'head' => :'PRBranchInfo', :'html_url' => :'String', :'id' => :'Integer', :'is_locked' => :'Boolean', :'labels' => :'Array<Label>', :'merge_base' => :'String', :'merge_commit_sha' => :'String', :'mergeable' => :'Boolean', :'merged' => :'Boolean', :'merged_at' => :'Time', :'merged_by' => :'User', :'milestone' => :'Milestone', :'number' => :'Integer', :'patch_url' => :'String', :'pin_order' => :'Integer', :'requested_reviewers' => :'Array<User>', :'requested_reviewers_teams' => :'Array<Team>', :'review_comments' => :'Integer', :'state' => :'String', :'title' => :'String', :'updated_at' => :'Time', :'url' => :'String', :'user' => :'User' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'lib/forgejo/models/pull_request.rb', line 387 def ==(o) return true if self.equal?(o) self.class == o.class && additions == o.additions && allow_maintainer_edit == o.allow_maintainer_edit && assignee == o.assignee && assignees == o.assignees && base == o.base && body == o.body && changed_files == o.changed_files && closed_at == o.closed_at && comments == o.comments && created_at == o.created_at && deletions == o.deletions && diff_url == o.diff_url && draft == o.draft && due_date == o.due_date && head == o.head && html_url == o.html_url && id == o.id && is_locked == o.is_locked && labels == o.labels && merge_base == o.merge_base && merge_commit_sha == o.merge_commit_sha && mergeable == o.mergeable && merged == o.merged && merged_at == o.merged_at && merged_by == o.merged_by && milestone == o.milestone && number == o.number && patch_url == o.patch_url && pin_order == o.pin_order && requested_reviewers == o.requested_reviewers && requested_reviewers_teams == o.requested_reviewers_teams && review_comments == o.review_comments && state == o.state && title == o.title && updated_at == o.updated_at && url == o.url && user == o.user end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
539 540 541 542 543 544 545 546 547 548 549 550 551 |
# File 'lib/forgejo/models/pull_request.rb', line 539 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
431 432 433 |
# File 'lib/forgejo/models/pull_request.rb', line 431 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
437 438 439 |
# File 'lib/forgejo/models/pull_request.rb', line 437 def hash [additions, allow_maintainer_edit, assignee, assignees, base, body, changed_files, closed_at, comments, created_at, deletions, diff_url, draft, due_date, head, html_url, id, is_locked, labels, merge_base, merge_commit_sha, mergeable, merged, merged_at, merged_by, milestone, number, patch_url, pin_order, requested_reviewers, requested_reviewers_teams, review_comments, state, title, updated_at, url, user].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
372 373 374 375 376 |
# File 'lib/forgejo/models/pull_request.rb', line 372 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
515 516 517 |
# File 'lib/forgejo/models/pull_request.rb', line 515 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
521 522 523 524 525 526 527 528 529 530 531 532 533 |
# File 'lib/forgejo/models/pull_request.rb', line 521 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
509 510 511 |
# File 'lib/forgejo/models/pull_request.rb', line 509 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
380 381 382 383 |
# File 'lib/forgejo/models/pull_request.rb', line 380 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |