Class: Weblate::NotificationEnum

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Class Method Details

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



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

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



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