Class: Weblate::NotificationEnum
- Inherits:
-
Object
- Object
- Weblate::NotificationEnum
- Defined in:
- lib/weblate/models/notification_enum.rb
Constant Summary collapse
- REPOSITORY_NOTIFICATION =
"RepositoryNotification".freeze
- LOCK_NOTIFICATION =
"LockNotification".freeze
- LICENSE_NOTIFICATION =
"LicenseNotification".freeze
- PARSE_ERROR_NOTIFICATION =
"ParseErrorNotification".freeze
- NEW_STRING_NOTIFICATON =
"NewStringNotificaton".freeze
- NEW_CONTRIBUTOR_NOTIFICATON =
"NewContributorNotificaton".freeze
- NEW_SUGGESTION_NOTIFICATON =
"NewSuggestionNotificaton".freeze
- LANGUAGE_TRANSLATED_NOTIFICATON =
"LanguageTranslatedNotificaton".freeze
- COMPONENT_TRANSLATED_NOTIFICATON =
"ComponentTranslatedNotificaton".freeze
- NEW_COMMENT_NOTIFICATON =
"NewCommentNotificaton".freeze
- MENTION_COMMENT_NOTIFICATON =
"MentionCommentNotificaton".freeze
- LAST_AUTHOR_COMMENT_NOTIFICATON =
"LastAuthorCommentNotificaton".freeze
- TRANSLATED_STRING_NOTIFICATON =
"TranslatedStringNotificaton".freeze
- APPROVED_STRING_NOTIFICATON =
"ApprovedStringNotificaton".freeze
- CHANGED_STRING_NOTIFICATON =
"ChangedStringNotificaton".freeze
- NEW_TRANSLATION_NOTIFICATON =
"NewTranslationNotificaton".freeze
- NEW_COMPONENT_NOTIFICATON =
"NewComponentNotificaton".freeze
- NEW_ANNOUNCEMENT_NOTIFICATON =
"NewAnnouncementNotificaton".freeze
- NEW_ALERT_NOTIFICATON =
"NewAlertNotificaton".freeze
- MERGE_FAILURE_NOTIFICATION =
"MergeFailureNotification".freeze
- PENDING_SUGGESTIONS_NOTIFICATION =
"PendingSuggestionsNotification".freeze
- TO_DO_STRINGS_NOTIFICATION =
"ToDoStringsNotification".freeze
Class Method Summary collapse
- .all_vars ⇒ Object
-
.build_from_hash(value) ⇒ String
Builds the enum from string.
Instance Method Summary collapse
-
#build_from_hash(value) ⇒ String
Builds the enum from string.
Class Method Details
.all_vars ⇒ Object
41 42 43 |
# File 'lib/weblate/models/notification_enum.rb', line 41 def self.all_vars @all_vars ||= [REPOSITORY_NOTIFICATION, LOCK_NOTIFICATION, LICENSE_NOTIFICATION, PARSE_ERROR_NOTIFICATION, NEW_STRING_NOTIFICATON, NEW_CONTRIBUTOR_NOTIFICATON, NEW_SUGGESTION_NOTIFICATON, LANGUAGE_TRANSLATED_NOTIFICATON, COMPONENT_TRANSLATED_NOTIFICATON, NEW_COMMENT_NOTIFICATON, MENTION_COMMENT_NOTIFICATON, LAST_AUTHOR_COMMENT_NOTIFICATON, TRANSLATED_STRING_NOTIFICATON, APPROVED_STRING_NOTIFICATON, CHANGED_STRING_NOTIFICATON, NEW_TRANSLATION_NOTIFICATON, NEW_COMPONENT_NOTIFICATON, NEW_ANNOUNCEMENT_NOTIFICATON, NEW_ALERT_NOTIFICATON, MERGE_FAILURE_NOTIFICATION, PENDING_SUGGESTIONS_NOTIFICATION, TO_DO_STRINGS_NOTIFICATION].freeze end |
.build_from_hash(value) ⇒ String
Builds the enum from string
48 49 50 |
# File 'lib/weblate/models/notification_enum.rb', line 48 def self.build_from_hash(value) new.build_from_hash(value) end |
Instance Method Details
#build_from_hash(value) ⇒ String
Builds the enum from string
55 56 57 58 |
# File 'lib/weblate/models/notification_enum.rb', line 55 def build_from_hash(value) return value if NotificationEnum.all_vars.include?(value) raise "Invalid ENUM value #{value} for class #NotificationEnum" end |