Class: Weblate::PatchedComponent
- Inherits:
-
Object
- Object
- Weblate::PatchedComponent
- Defined in:
- lib/weblate/models/patched_component.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#add_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
-
#addon_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
-
#addons ⇒ Object
Returns the value of attribute addons.
-
#agreement ⇒ Object
User agreement which needs to be approved before a user can translate this component.
-
#allow_translation_propagation ⇒ Object
Whether translation updates in other components will cause automatic translation in this one.
-
#auto_lock_error ⇒ Object
Whether the component should be locked on repository errors.
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#category ⇒ Object
Returns the value of attribute category.
-
#changes_list_url ⇒ Object
Returns the value of attribute changes_list_url.
-
#check_flags ⇒ Object
Additional comma-separated flags to influence Weblate behavior.
-
#commit_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
-
#commit_pending_age ⇒ Object
Time in hours after which any pending changes will be committed to the VCS.
-
#credits_url ⇒ Object
Returns the value of attribute credits_url.
-
#delete_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
-
#disable_autoshare ⇒ Object
Returns the value of attribute disable_autoshare.
-
#docfile ⇒ Object
Returns the value of attribute docfile.
-
#edit_template ⇒ Object
Whether users will be able to edit the base file for monolingual translations.
-
#enable_suggestions ⇒ Object
Whether to allow translation suggestions at all.
-
#enforced_checks ⇒ Object
Returns the value of attribute enforced_checks.
-
#file_format ⇒ Object
Returns the value of attribute file_format.
-
#filemask ⇒ Object
Path of files to translate relative to repository root, use * instead of language code, for example: po/*.po or locale/*/LC_MESSAGES/django.po.
-
#git_export ⇒ Object
URL of repository where users can fetch changes from Weblate.
-
#glossary_color ⇒ Object
Returns the value of attribute glossary_color.
-
#id ⇒ Object
Returns the value of attribute id.
-
#intermediate ⇒ Object
Filename of intermediate translation file.
-
#is_glossary ⇒ Object
Returns the value of attribute is_glossary.
-
#key_filter ⇒ Object
Regular expression used to filter keys.
-
#language_code_style ⇒ Object
Returns the value of attribute language_code_style.
-
#language_regex ⇒ Object
Regular expression used to filter translation files when scanning for file mask.
-
#license ⇒ Object
Returns the value of attribute license.
-
#license_url ⇒ Object
Returns the value of attribute license_url.
-
#linked_component ⇒ Object
Returns the value of attribute linked_component.
-
#links_url ⇒ Object
Returns the value of attribute links_url.
-
#lock_url ⇒ Object
Returns the value of attribute lock_url.
-
#manage_units ⇒ Object
Enables adding and removing strings straight from Weblate.
-
#merge_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
-
#merge_style ⇒ Object
Define whether Weblate should merge the upstream repository or rebase changes onto it.
-
#name ⇒ Object
Display name.
-
#new_base ⇒ Object
Filename of file used for creating new translations.
-
#new_lang ⇒ Object
How to handle requests for creating new translations.
-
#priority ⇒ Object
Components with higher priority are offered first to translators.
-
#project ⇒ Object
Returns the value of attribute project.
-
#pull_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
-
#push ⇒ Object
Returns the value of attribute push.
-
#push_branch ⇒ Object
Returns the value of attribute push_branch.
-
#push_on_commit ⇒ Object
Whether the repository should be pushed upstream on every commit.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#report_source_bugs ⇒ Object
E-mail address for reports on errors in source strings.
-
#repository_url ⇒ Object
Returns the value of attribute repository_url.
-
#repoweb ⇒ Object
Link to repository browser, use {branch} for branch, {filename} and {line} as filename and line placeholders.
-
#restricted ⇒ Object
Restrict access to the component to only those explicitly given permission.
-
#screenshot_filemask ⇒ Object
Path of screenshots relative to repository root, for example: docs/screenshots/*.png.
-
#slug ⇒ Object
Name used in URLs and filenames.
-
#source_language ⇒ Object
Returns the value of attribute source_language.
-
#statistics_url ⇒ Object
Returns the value of attribute statistics_url.
-
#suggestion_autoaccept ⇒ Object
Automatically accept suggestions with this number of votes, use 0 to turn it off.
-
#suggestion_voting ⇒ Object
Users can only vote for suggestions and can’t make direct translations.
-
#task_url ⇒ Object
Returns the value of attribute task_url.
-
#template ⇒ Object
Filename of translation base file, containing all strings and their source for monolingual translations.
-
#translations_url ⇒ Object
Returns the value of attribute translations_url.
-
#url ⇒ Object
Returns the value of attribute url.
-
#variant_regex ⇒ Object
Regular expression used to determine variants of a string.
-
#vcs ⇒ Object
Version control system to use to access your repository containing translations.
-
#web_url ⇒ Object
Returns the value of attribute web_url.
-
#zipfile ⇒ Object
Returns the value of attribute zipfile.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.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 = {}) ⇒ PatchedComponent
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 = {}) ⇒ PatchedComponent
Initializes the object
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 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 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 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 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 |
# File 'lib/weblate/models/patched_component.rb', line 363 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Weblate::PatchedComponent` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Weblate::PatchedComponent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'slug') self.slug = attributes[:'slug'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'source_language') self.source_language = attributes[:'source_language'] end if attributes.key?(:'project') self.project = attributes[:'project'] end if attributes.key?(:'vcs') self.vcs = attributes[:'vcs'] end if attributes.key?(:'repo') self.repo = attributes[:'repo'] end if attributes.key?(:'git_export') self.git_export = attributes[:'git_export'] end if attributes.key?(:'branch') self.branch = attributes[:'branch'] end if attributes.key?(:'push_branch') self.push_branch = attributes[:'push_branch'] end if attributes.key?(:'filemask') self.filemask = attributes[:'filemask'] end if attributes.key?(:'screenshot_filemask') self.screenshot_filemask = attributes[:'screenshot_filemask'] end if attributes.key?(:'template') self.template = attributes[:'template'] end if attributes.key?(:'edit_template') self.edit_template = attributes[:'edit_template'] end if attributes.key?(:'intermediate') self.intermediate = attributes[:'intermediate'] end if attributes.key?(:'new_base') self.new_base = attributes[:'new_base'] end if attributes.key?(:'file_format') self.file_format = attributes[:'file_format'] end if attributes.key?(:'license') self.license = attributes[:'license'] end if attributes.key?(:'license_url') self.license_url = attributes[:'license_url'] end if attributes.key?(:'agreement') self.agreement = attributes[:'agreement'] end if attributes.key?(:'web_url') self.web_url = attributes[:'web_url'] end if attributes.key?(:'url') self.url = attributes[:'url'] end if attributes.key?(:'repository_url') self.repository_url = attributes[:'repository_url'] end if attributes.key?(:'translations_url') self.translations_url = attributes[:'translations_url'] end if attributes.key?(:'statistics_url') self.statistics_url = attributes[:'statistics_url'] end if attributes.key?(:'lock_url') self.lock_url = attributes[:'lock_url'] end if attributes.key?(:'links_url') self.links_url = attributes[:'links_url'] end if attributes.key?(:'changes_list_url') self.changes_list_url = attributes[:'changes_list_url'] end if attributes.key?(:'task_url') self.task_url = attributes[:'task_url'] end if attributes.key?(:'credits_url') self.credits_url = attributes[:'credits_url'] end if attributes.key?(:'new_lang') self.new_lang = attributes[:'new_lang'] end if attributes.key?(:'language_code_style') self.language_code_style = attributes[:'language_code_style'] end if attributes.key?(:'push') self.push = attributes[:'push'] end if attributes.key?(:'check_flags') self.check_flags = attributes[:'check_flags'] end if attributes.key?(:'priority') self.priority = attributes[:'priority'] end if attributes.key?(:'enforced_checks') self.enforced_checks = attributes[:'enforced_checks'] end if attributes.key?(:'restricted') self.restricted = attributes[:'restricted'] end if attributes.key?(:'repoweb') self.repoweb = attributes[:'repoweb'] end if attributes.key?(:'report_source_bugs') self.report_source_bugs = attributes[:'report_source_bugs'] end if attributes.key?(:'merge_style') self.merge_style = attributes[:'merge_style'] end if attributes.key?(:'commit_message') self. = attributes[:'commit_message'] end if attributes.key?(:'add_message') self. = attributes[:'add_message'] end if attributes.key?(:'delete_message') self. = attributes[:'delete_message'] end if attributes.key?(:'merge_message') self. = attributes[:'merge_message'] end if attributes.key?(:'addon_message') self. = attributes[:'addon_message'] end if attributes.key?(:'pull_message') self. = attributes[:'pull_message'] end if attributes.key?(:'allow_translation_propagation') self.allow_translation_propagation = attributes[:'allow_translation_propagation'] end if attributes.key?(:'manage_units') self.manage_units = attributes[:'manage_units'] end if attributes.key?(:'enable_suggestions') self.enable_suggestions = attributes[:'enable_suggestions'] end if attributes.key?(:'suggestion_voting') self.suggestion_voting = attributes[:'suggestion_voting'] end if attributes.key?(:'suggestion_autoaccept') self.suggestion_autoaccept = attributes[:'suggestion_autoaccept'] end if attributes.key?(:'push_on_commit') self.push_on_commit = attributes[:'push_on_commit'] end if attributes.key?(:'commit_pending_age') self.commit_pending_age = attributes[:'commit_pending_age'] end if attributes.key?(:'auto_lock_error') self.auto_lock_error = attributes[:'auto_lock_error'] end if attributes.key?(:'language_regex') self.language_regex = attributes[:'language_regex'] end if attributes.key?(:'key_filter') self.key_filter = attributes[:'key_filter'] end if attributes.key?(:'variant_regex') self.variant_regex = attributes[:'variant_regex'] end if attributes.key?(:'zipfile') self.zipfile = attributes[:'zipfile'] end if attributes.key?(:'docfile') self.docfile = attributes[:'docfile'] end if attributes.key?(:'addons') if (value = attributes[:'addons']).is_a?(Array) self.addons = value end end if attributes.key?(:'is_glossary') self.is_glossary = attributes[:'is_glossary'] end if attributes.key?(:'glossary_color') self.glossary_color = attributes[:'glossary_color'] end if attributes.key?(:'disable_autoshare') self.disable_autoshare = attributes[:'disable_autoshare'] end if attributes.key?(:'category') self.category = attributes[:'category'] end if attributes.key?(:'linked_component') self.linked_component = attributes[:'linked_component'] end end |
Instance Attribute Details
#add_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
120 121 122 |
# File 'lib/weblate/models/patched_component.rb', line 120 def @add_message end |
#addon_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
129 130 131 |
# File 'lib/weblate/models/patched_component.rb', line 129 def @addon_message end |
#addons ⇒ Object
Returns the value of attribute addons.
171 172 173 |
# File 'lib/weblate/models/patched_component.rb', line 171 def addons @addons end |
#agreement ⇒ Object
User agreement which needs to be approved before a user can translate this component.
67 68 69 |
# File 'lib/weblate/models/patched_component.rb', line 67 def agreement @agreement end |
#allow_translation_propagation ⇒ Object
Whether translation updates in other components will cause automatic translation in this one
135 136 137 |
# File 'lib/weblate/models/patched_component.rb', line 135 def allow_translation_propagation @allow_translation_propagation end |
#auto_lock_error ⇒ Object
Whether the component should be locked on repository errors.
156 157 158 |
# File 'lib/weblate/models/patched_component.rb', line 156 def auto_lock_error @auto_lock_error end |
#branch ⇒ Object
Returns the value of attribute branch.
38 39 40 |
# File 'lib/weblate/models/patched_component.rb', line 38 def branch @branch end |
#category ⇒ Object
Returns the value of attribute category.
179 180 181 |
# File 'lib/weblate/models/patched_component.rb', line 179 def category @category end |
#changes_list_url ⇒ Object
Returns the value of attribute changes_list_url.
83 84 85 |
# File 'lib/weblate/models/patched_component.rb', line 83 def changes_list_url @changes_list_url end |
#check_flags ⇒ Object
Additional comma-separated flags to influence Weblate behavior.
97 98 99 |
# File 'lib/weblate/models/patched_component.rb', line 97 def check_flags @check_flags end |
#commit_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
117 118 119 |
# File 'lib/weblate/models/patched_component.rb', line 117 def @commit_message end |
#commit_pending_age ⇒ Object
Time in hours after which any pending changes will be committed to the VCS.
153 154 155 |
# File 'lib/weblate/models/patched_component.rb', line 153 def commit_pending_age @commit_pending_age end |
#credits_url ⇒ Object
Returns the value of attribute credits_url.
87 88 89 |
# File 'lib/weblate/models/patched_component.rb', line 87 def credits_url @credits_url end |
#delete_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
123 124 125 |
# File 'lib/weblate/models/patched_component.rb', line 123 def @delete_message end |
#disable_autoshare ⇒ Object
Returns the value of attribute disable_autoshare.
177 178 179 |
# File 'lib/weblate/models/patched_component.rb', line 177 def disable_autoshare @disable_autoshare end |
#docfile ⇒ Object
Returns the value of attribute docfile.
169 170 171 |
# File 'lib/weblate/models/patched_component.rb', line 169 def docfile @docfile end |
#edit_template ⇒ Object
Whether users will be able to edit the base file for monolingual translations.
52 53 54 |
# File 'lib/weblate/models/patched_component.rb', line 52 def edit_template @edit_template end |
#enable_suggestions ⇒ Object
Whether to allow translation suggestions at all.
141 142 143 |
# File 'lib/weblate/models/patched_component.rb', line 141 def enable_suggestions @enable_suggestions end |
#enforced_checks ⇒ Object
Returns the value of attribute enforced_checks.
102 103 104 |
# File 'lib/weblate/models/patched_component.rb', line 102 def enforced_checks @enforced_checks end |
#file_format ⇒ Object
Returns the value of attribute file_format.
60 61 62 |
# File 'lib/weblate/models/patched_component.rb', line 60 def file_format @file_format end |
#filemask ⇒ Object
Path of files to translate relative to repository root, use * instead of language code, for example: po/*.po or locale/*/LC_MESSAGES/django.po.
43 44 45 |
# File 'lib/weblate/models/patched_component.rb', line 43 def filemask @filemask end |
#git_export ⇒ Object
URL of repository where users can fetch changes from Weblate
36 37 38 |
# File 'lib/weblate/models/patched_component.rb', line 36 def git_export @git_export end |
#glossary_color ⇒ Object
Returns the value of attribute glossary_color.
175 176 177 |
# File 'lib/weblate/models/patched_component.rb', line 175 def glossary_color @glossary_color end |
#id ⇒ Object
Returns the value of attribute id.
24 25 26 |
# File 'lib/weblate/models/patched_component.rb', line 24 def id @id end |
#intermediate ⇒ Object
Filename of intermediate translation file. In most cases this is a translation file provided by developers and is used when creating actual source strings.
55 56 57 |
# File 'lib/weblate/models/patched_component.rb', line 55 def intermediate @intermediate end |
#is_glossary ⇒ Object
Returns the value of attribute is_glossary.
173 174 175 |
# File 'lib/weblate/models/patched_component.rb', line 173 def is_glossary @is_glossary end |
#key_filter ⇒ Object
Regular expression used to filter keys. This is only available for monolingual formats.
162 163 164 |
# File 'lib/weblate/models/patched_component.rb', line 162 def key_filter @key_filter end |
#language_code_style ⇒ Object
Returns the value of attribute language_code_style.
92 93 94 |
# File 'lib/weblate/models/patched_component.rb', line 92 def language_code_style @language_code_style end |
#language_regex ⇒ Object
Regular expression used to filter translation files when scanning for file mask.
159 160 161 |
# File 'lib/weblate/models/patched_component.rb', line 159 def language_regex @language_regex end |
#license ⇒ Object
Returns the value of attribute license.
62 63 64 |
# File 'lib/weblate/models/patched_component.rb', line 62 def license @license end |
#license_url ⇒ Object
Returns the value of attribute license_url.
64 65 66 |
# File 'lib/weblate/models/patched_component.rb', line 64 def license_url @license_url end |
#linked_component ⇒ Object
Returns the value of attribute linked_component.
181 182 183 |
# File 'lib/weblate/models/patched_component.rb', line 181 def linked_component @linked_component end |
#links_url ⇒ Object
Returns the value of attribute links_url.
81 82 83 |
# File 'lib/weblate/models/patched_component.rb', line 81 def links_url @links_url end |
#lock_url ⇒ Object
Returns the value of attribute lock_url.
79 80 81 |
# File 'lib/weblate/models/patched_component.rb', line 79 def lock_url @lock_url end |
#manage_units ⇒ Object
Enables adding and removing strings straight from Weblate. If your strings are extracted from the source code or managed externally you probably want to keep it disabled.
138 139 140 |
# File 'lib/weblate/models/patched_component.rb', line 138 def manage_units @manage_units end |
#merge_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
126 127 128 |
# File 'lib/weblate/models/patched_component.rb', line 126 def @merge_message end |
#merge_style ⇒ Object
Define whether Weblate should merge the upstream repository or rebase changes onto it. * ‘merge` - Merge * `rebase` - Rebase * `merge_noff` - Merge without fast-forward
114 115 116 |
# File 'lib/weblate/models/patched_component.rb', line 114 def merge_style @merge_style end |
#name ⇒ Object
Display name
19 20 21 |
# File 'lib/weblate/models/patched_component.rb', line 19 def name @name end |
#new_base ⇒ Object
Filename of file used for creating new translations. For gettext choose .pot file.
58 59 60 |
# File 'lib/weblate/models/patched_component.rb', line 58 def new_base @new_base end |
#new_lang ⇒ Object
How to handle requests for creating new translations. * ‘contact` - Contact maintainers * `url` - Point to translation instructions URL * `add` - Create new language file * `none` - Disable adding new translations
90 91 92 |
# File 'lib/weblate/models/patched_component.rb', line 90 def new_lang @new_lang end |
#priority ⇒ Object
Components with higher priority are offered first to translators. * ‘60` - Very high * `80` - High * `100` - Medium * `120` - Low * `140` - Very low
100 101 102 |
# File 'lib/weblate/models/patched_component.rb', line 100 def priority @priority end |
#project ⇒ Object
Returns the value of attribute project.
28 29 30 |
# File 'lib/weblate/models/patched_component.rb', line 28 def project @project end |
#pull_message ⇒ Object
You can use template language for various info, please consult the documentation for more details.
132 133 134 |
# File 'lib/weblate/models/patched_component.rb', line 132 def @pull_message end |
#push ⇒ Object
Returns the value of attribute push.
94 95 96 |
# File 'lib/weblate/models/patched_component.rb', line 94 def push @push end |
#push_branch ⇒ Object
Returns the value of attribute push_branch.
40 41 42 |
# File 'lib/weblate/models/patched_component.rb', line 40 def push_branch @push_branch end |
#push_on_commit ⇒ Object
Whether the repository should be pushed upstream on every commit.
150 151 152 |
# File 'lib/weblate/models/patched_component.rb', line 150 def push_on_commit @push_on_commit end |
#repo ⇒ Object
Returns the value of attribute repo.
33 34 35 |
# File 'lib/weblate/models/patched_component.rb', line 33 def repo @repo end |
#report_source_bugs ⇒ Object
E-mail address for reports on errors in source strings. Leave empty for no e-mails.
111 112 113 |
# File 'lib/weblate/models/patched_component.rb', line 111 def report_source_bugs @report_source_bugs end |
#repository_url ⇒ Object
Returns the value of attribute repository_url.
73 74 75 |
# File 'lib/weblate/models/patched_component.rb', line 73 def repository_url @repository_url end |
#repoweb ⇒ Object
Link to repository browser, use {branch} for branch, {filename} and {line} as filename and line placeholders. You might want to strip leading directory by using {filename|parentdir}.
108 109 110 |
# File 'lib/weblate/models/patched_component.rb', line 108 def repoweb @repoweb end |
#restricted ⇒ Object
Restrict access to the component to only those explicitly given permission.
105 106 107 |
# File 'lib/weblate/models/patched_component.rb', line 105 def restricted @restricted end |
#screenshot_filemask ⇒ Object
Path of screenshots relative to repository root, for example: docs/screenshots/*.png.
46 47 48 |
# File 'lib/weblate/models/patched_component.rb', line 46 def screenshot_filemask @screenshot_filemask end |
#slug ⇒ Object
Name used in URLs and filenames.
22 23 24 |
# File 'lib/weblate/models/patched_component.rb', line 22 def slug @slug end |
#source_language ⇒ Object
Returns the value of attribute source_language.
26 27 28 |
# File 'lib/weblate/models/patched_component.rb', line 26 def source_language @source_language end |
#statistics_url ⇒ Object
Returns the value of attribute statistics_url.
77 78 79 |
# File 'lib/weblate/models/patched_component.rb', line 77 def statistics_url @statistics_url end |
#suggestion_autoaccept ⇒ Object
Automatically accept suggestions with this number of votes, use 0 to turn it off.
147 148 149 |
# File 'lib/weblate/models/patched_component.rb', line 147 def suggestion_autoaccept @suggestion_autoaccept end |
#suggestion_voting ⇒ Object
Users can only vote for suggestions and can’t make direct translations.
144 145 146 |
# File 'lib/weblate/models/patched_component.rb', line 144 def suggestion_voting @suggestion_voting end |
#task_url ⇒ Object
Returns the value of attribute task_url.
85 86 87 |
# File 'lib/weblate/models/patched_component.rb', line 85 def task_url @task_url end |
#template ⇒ Object
Filename of translation base file, containing all strings and their source for monolingual translations.
49 50 51 |
# File 'lib/weblate/models/patched_component.rb', line 49 def template @template end |
#translations_url ⇒ Object
Returns the value of attribute translations_url.
75 76 77 |
# File 'lib/weblate/models/patched_component.rb', line 75 def translations_url @translations_url end |
#url ⇒ Object
Returns the value of attribute url.
71 72 73 |
# File 'lib/weblate/models/patched_component.rb', line 71 def url @url end |
#variant_regex ⇒ Object
Regular expression used to determine variants of a string.
165 166 167 |
# File 'lib/weblate/models/patched_component.rb', line 165 def variant_regex @variant_regex end |
#vcs ⇒ Object
Version control system to use to access your repository containing translations. You can also choose additional integration with third party providers to submit merge requests. * ‘gerrit` - Gerrit * `git` - Git * `git-force-push` - Git with force push * `github` - GitHub pull request * `gitlab` - GitLab merge request * `local` - No remote repository * `mercurial` - Mercurial * `subversion` - Subversion
31 32 33 |
# File 'lib/weblate/models/patched_component.rb', line 31 def vcs @vcs end |
#web_url ⇒ Object
Returns the value of attribute web_url.
69 70 71 |
# File 'lib/weblate/models/patched_component.rb', line 69 def web_url @web_url end |
#zipfile ⇒ Object
Returns the value of attribute zipfile.
167 168 169 |
# File 'lib/weblate/models/patched_component.rb', line 167 def zipfile @zipfile end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 |
# File 'lib/weblate/models/patched_component.rb', line 1155 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 = Weblate.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_attributes ⇒ Object
Returns all the JSON keys this model knows about
277 278 279 |
# File 'lib/weblate/models/patched_component.rb', line 277 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/weblate/models/patched_component.rb', line 206 def self.attribute_map { :'name' => :'name', :'slug' => :'slug', :'id' => :'id', :'source_language' => :'source_language', :'project' => :'project', :'vcs' => :'vcs', :'repo' => :'repo', :'git_export' => :'git_export', :'branch' => :'branch', :'push_branch' => :'push_branch', :'filemask' => :'filemask', :'screenshot_filemask' => :'screenshot_filemask', :'template' => :'template', :'edit_template' => :'edit_template', :'intermediate' => :'intermediate', :'new_base' => :'new_base', :'file_format' => :'file_format', :'license' => :'license', :'license_url' => :'license_url', :'agreement' => :'agreement', :'web_url' => :'web_url', :'url' => :'url', :'repository_url' => :'repository_url', :'translations_url' => :'translations_url', :'statistics_url' => :'statistics_url', :'lock_url' => :'lock_url', :'links_url' => :'links_url', :'changes_list_url' => :'changes_list_url', :'task_url' => :'task_url', :'credits_url' => :'credits_url', :'new_lang' => :'new_lang', :'language_code_style' => :'language_code_style', :'push' => :'push', :'check_flags' => :'check_flags', :'priority' => :'priority', :'enforced_checks' => :'enforced_checks', :'restricted' => :'restricted', :'repoweb' => :'repoweb', :'report_source_bugs' => :'report_source_bugs', :'merge_style' => :'merge_style', :'commit_message' => :'commit_message', :'add_message' => :'add_message', :'delete_message' => :'delete_message', :'merge_message' => :'merge_message', :'addon_message' => :'addon_message', :'pull_message' => :'pull_message', :'allow_translation_propagation' => :'allow_translation_propagation', :'manage_units' => :'manage_units', :'enable_suggestions' => :'enable_suggestions', :'suggestion_voting' => :'suggestion_voting', :'suggestion_autoaccept' => :'suggestion_autoaccept', :'push_on_commit' => :'push_on_commit', :'commit_pending_age' => :'commit_pending_age', :'auto_lock_error' => :'auto_lock_error', :'language_regex' => :'language_regex', :'key_filter' => :'key_filter', :'variant_regex' => :'variant_regex', :'zipfile' => :'zipfile', :'docfile' => :'docfile', :'addons' => :'addons', :'is_glossary' => :'is_glossary', :'glossary_color' => :'glossary_color', :'disable_autoshare' => :'disable_autoshare', :'category' => :'category', :'linked_component' => :'linked_component' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 |
# File 'lib/weblate/models/patched_component.rb', line 1131 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
353 354 355 356 357 358 359 |
# File 'lib/weblate/models/patched_component.rb', line 353 def self.openapi_nullable Set.new([ :'task_url', :'enforced_checks', :'category', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/weblate/models/patched_component.rb', line 282 def self.openapi_types { :'name' => :'String', :'slug' => :'String', :'id' => :'Integer', :'source_language' => :'Language', :'project' => :'Project', :'vcs' => :'VcsEnum', :'repo' => :'String', :'git_export' => :'String', :'branch' => :'String', :'push_branch' => :'String', :'filemask' => :'String', :'screenshot_filemask' => :'String', :'template' => :'String', :'edit_template' => :'Boolean', :'intermediate' => :'String', :'new_base' => :'String', :'file_format' => :'FileFormatEnum', :'license' => :'LicenseEnum', :'license_url' => :'String', :'agreement' => :'String', :'web_url' => :'String', :'url' => :'String', :'repository_url' => :'String', :'translations_url' => :'String', :'statistics_url' => :'String', :'lock_url' => :'String', :'links_url' => :'String', :'changes_list_url' => :'String', :'task_url' => :'String', :'credits_url' => :'String', :'new_lang' => :'NewLangEnum', :'language_code_style' => :'ComponentLanguageCodeStyle', :'push' => :'String', :'check_flags' => :'String', :'priority' => :'PriorityEnum', :'enforced_checks' => :'Object', :'restricted' => :'Boolean', :'repoweb' => :'String', :'report_source_bugs' => :'String', :'merge_style' => :'MergeStyleEnum', :'commit_message' => :'String', :'add_message' => :'String', :'delete_message' => :'String', :'merge_message' => :'String', :'addon_message' => :'String', :'pull_message' => :'String', :'allow_translation_propagation' => :'Boolean', :'manage_units' => :'Boolean', :'enable_suggestions' => :'Boolean', :'suggestion_voting' => :'Boolean', :'suggestion_autoaccept' => :'Integer', :'push_on_commit' => :'Boolean', :'commit_pending_age' => :'Integer', :'auto_lock_error' => :'Boolean', :'language_regex' => :'String', :'key_filter' => :'String', :'variant_regex' => :'String', :'zipfile' => :'String', :'docfile' => :'String', :'addons' => :'Array<String>', :'is_glossary' => :'Boolean', :'glossary_color' => :'ColorEnum', :'disable_autoshare' => :'Boolean', :'category' => :'String', :'linked_component' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 |
# File 'lib/weblate/models/patched_component.rb', line 1046 def ==(o) return true if self.equal?(o) self.class == o.class && name == o.name && slug == o.slug && id == o.id && source_language == o.source_language && project == o.project && vcs == o.vcs && repo == o.repo && git_export == o.git_export && branch == o.branch && push_branch == o.push_branch && filemask == o.filemask && screenshot_filemask == o.screenshot_filemask && template == o.template && edit_template == o.edit_template && intermediate == o.intermediate && new_base == o.new_base && file_format == o.file_format && license == o.license && license_url == o.license_url && agreement == o.agreement && web_url == o.web_url && url == o.url && repository_url == o.repository_url && translations_url == o.translations_url && statistics_url == o.statistics_url && lock_url == o.lock_url && links_url == o.links_url && changes_list_url == o.changes_list_url && task_url == o.task_url && credits_url == o.credits_url && new_lang == o.new_lang && language_code_style == o.language_code_style && push == o.push && check_flags == o.check_flags && priority == o.priority && enforced_checks == o.enforced_checks && restricted == o.restricted && repoweb == o.repoweb && report_source_bugs == o.report_source_bugs && merge_style == o.merge_style && == o. && == o. && == o. && == o. && == o. && == o. && allow_translation_propagation == o.allow_translation_propagation && manage_units == o.manage_units && enable_suggestions == o.enable_suggestions && suggestion_voting == o.suggestion_voting && suggestion_autoaccept == o.suggestion_autoaccept && push_on_commit == o.push_on_commit && commit_pending_age == o.commit_pending_age && auto_lock_error == o.auto_lock_error && language_regex == o.language_regex && key_filter == o.key_filter && variant_regex == o.variant_regex && zipfile == o.zipfile && docfile == o.docfile && addons == o.addons && is_glossary == o.is_glossary && glossary_color == o.glossary_color && disable_autoshare == o.disable_autoshare && category == o.category && linked_component == o.linked_component end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 |
# File 'lib/weblate/models/patched_component.rb', line 1226 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
1118 1119 1120 |
# File 'lib/weblate/models/patched_component.rb', line 1118 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
1124 1125 1126 |
# File 'lib/weblate/models/patched_component.rb', line 1124 def hash [name, slug, id, source_language, project, vcs, repo, git_export, branch, push_branch, filemask, screenshot_filemask, template, edit_template, intermediate, new_base, file_format, license, license_url, agreement, web_url, url, repository_url, translations_url, statistics_url, lock_url, links_url, changes_list_url, task_url, credits_url, new_lang, language_code_style, push, check_flags, priority, enforced_checks, restricted, repoweb, report_source_bugs, merge_style, , , , , , , allow_translation_propagation, manage_units, enable_suggestions, suggestion_voting, suggestion_autoaccept, push_on_commit, commit_pending_age, auto_lock_error, language_regex, key_filter, variant_regex, zipfile, docfile, addons, is_glossary, glossary_color, disable_autoshare, category, linked_component].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 |
# File 'lib/weblate/models/patched_component.rb', line 641 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@name.nil? && @name.to_s.length > 100 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') end if !@slug.nil? && @slug.to_s.length > 100 invalid_properties.push('invalid value for "slug", the character length must be smaller than or equal to 100.') end pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/) if !@slug.nil? && @slug !~ pattern invalid_properties.push("invalid value for \"slug\", must conform to the pattern #{pattern}.") end if !@repo.nil? && @repo.to_s.length > 300 invalid_properties.push('invalid value for "repo", the character length must be smaller than or equal to 300.') end if !@git_export.nil? && @git_export.to_s.length > 220 invalid_properties.push('invalid value for "git_export", the character length must be smaller than or equal to 220.') end if !@branch.nil? && @branch.to_s.length > 200 invalid_properties.push('invalid value for "branch", the character length must be smaller than or equal to 200.') end if !@push_branch.nil? && @push_branch.to_s.length > 200 invalid_properties.push('invalid value for "push_branch", the character length must be smaller than or equal to 200.') end if !@filemask.nil? && @filemask.to_s.length > 400 invalid_properties.push('invalid value for "filemask", the character length must be smaller than or equal to 400.') end if !@screenshot_filemask.nil? && @screenshot_filemask.to_s.length > 400 invalid_properties.push('invalid value for "screenshot_filemask", the character length must be smaller than or equal to 400.') end if !@template.nil? && @template.to_s.length > 400 invalid_properties.push('invalid value for "template", the character length must be smaller than or equal to 400.') end if !@intermediate.nil? && @intermediate.to_s.length > 400 invalid_properties.push('invalid value for "intermediate", the character length must be smaller than or equal to 400.') end if !@new_base.nil? && @new_base.to_s.length > 400 invalid_properties.push('invalid value for "new_base", the character length must be smaller than or equal to 400.') end if !@push.nil? && @push.to_s.length > 300 invalid_properties.push('invalid value for "push", the character length must be smaller than or equal to 300.') end if !@repoweb.nil? && @repoweb.to_s.length > 200 invalid_properties.push('invalid value for "repoweb", the character length must be smaller than or equal to 200.') end if !@report_source_bugs.nil? && @report_source_bugs.to_s.length > 190 invalid_properties.push('invalid value for "report_source_bugs", the character length must be smaller than or equal to 190.') end if !@suggestion_autoaccept.nil? && @suggestion_autoaccept > 32767 invalid_properties.push('invalid value for "suggestion_autoaccept", must be smaller than or equal to 32767.') end if !@suggestion_autoaccept.nil? && @suggestion_autoaccept < 0 invalid_properties.push('invalid value for "suggestion_autoaccept", must be greater than or equal to 0.') end if !@commit_pending_age.nil? && @commit_pending_age > 2160 invalid_properties.push('invalid value for "commit_pending_age", must be smaller than or equal to 2160.') end if !@commit_pending_age.nil? && @commit_pending_age < -32768 invalid_properties.push('invalid value for "commit_pending_age", must be greater than or equal to -32768.') end if !@language_regex.nil? && @language_regex.to_s.length > 500 invalid_properties.push('invalid value for "language_regex", the character length must be smaller than or equal to 500.') end if !@key_filter.nil? && @key_filter.to_s.length > 500 invalid_properties.push('invalid value for "key_filter", the character length must be smaller than or equal to 500.') end if !@variant_regex.nil? && @variant_regex.to_s.length > 190 invalid_properties.push('invalid value for "variant_regex", the character length must be smaller than or equal to 190.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
1202 1203 1204 |
# File 'lib/weblate/models/patched_component.rb', line 1202 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 |
# File 'lib/weblate/models/patched_component.rb', line 1208 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
1196 1197 1198 |
# File 'lib/weblate/models/patched_component.rb', line 1196 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 |
# File 'lib/weblate/models/patched_component.rb', line 738 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@name.nil? && @name.to_s.length > 100 return false if !@slug.nil? && @slug.to_s.length > 100 return false if !@slug.nil? && @slug !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) return false if !@repo.nil? && @repo.to_s.length > 300 return false if !@git_export.nil? && @git_export.to_s.length > 220 return false if !@branch.nil? && @branch.to_s.length > 200 return false if !@push_branch.nil? && @push_branch.to_s.length > 200 return false if !@filemask.nil? && @filemask.to_s.length > 400 return false if !@screenshot_filemask.nil? && @screenshot_filemask.to_s.length > 400 return false if !@template.nil? && @template.to_s.length > 400 return false if !@intermediate.nil? && @intermediate.to_s.length > 400 return false if !@new_base.nil? && @new_base.to_s.length > 400 return false if !@push.nil? && @push.to_s.length > 300 return false if !@repoweb.nil? && @repoweb.to_s.length > 200 return false if !@report_source_bugs.nil? && @report_source_bugs.to_s.length > 190 return false if !@suggestion_autoaccept.nil? && @suggestion_autoaccept > 32767 return false if !@suggestion_autoaccept.nil? && @suggestion_autoaccept < 0 return false if !@commit_pending_age.nil? && @commit_pending_age > 2160 return false if !@commit_pending_age.nil? && @commit_pending_age < -32768 return false if !@language_regex.nil? && @language_regex.to_s.length > 500 return false if !@key_filter.nil? && @key_filter.to_s.length > 500 return false if !@variant_regex.nil? && @variant_regex.to_s.length > 190 true end |