Class: Weblate::FileFormatEnum

Inherits:
Object
  • Object
show all
Defined in:
lib/weblate/models/file_format_enum.rb

Constant Summary collapse

APPSTORE =
"appstore".freeze
ARB =
"arb".freeze
ARESOURCE =
"aresource".freeze
ASS =
"ass".freeze
CSV =
"csv".freeze
CSV_MULTI_UTF_8 =
"csv-multi-utf-8".freeze
CSV_SIMPLE =
"csv-simple".freeze
CSV_SIMPLE_ISO =
"csv-simple-iso".freeze
CSV_SIMPLE_UTF_8 =
"csv-simple-utf-8".freeze
CSV_UTF_8 =
"csv-utf-8".freeze
DOKUWIKI =
"dokuwiki".freeze
DTD =
"dtd".freeze
FLATXML =
"flatxml".freeze
FLUENT =
"fluent".freeze
FORMATJS =
"formatjs".freeze
GO_I18N_JSON =
"go-i18n-json".freeze
GO_I18N_JSON_V2 =
"go-i18n-json-v2".freeze
GOTEXT =
"gotext".freeze
GWT =
"gwt".freeze
GWT_ISO =
"gwt-iso".freeze
HTML =
"html".freeze
I18NEXT =
"i18next".freeze
I18NEXTV4 =
"i18nextv4".freeze
IDML =
"idml".freeze
INI =
"ini".freeze
ISLU =
"islu".freeze
JOOMLA =
"joomla".freeze
JSON =
"json".freeze
JSON_NESTED =
"json-nested".freeze
LARAVEL =
"laravel".freeze
MARKDOWN =
"markdown".freeze
MEDIAWIKI =
"mediawiki".freeze
MI18N_LANG =
"mi18n-lang".freeze
MOKO_RESOURCE =
"moko-resource".freeze
ODF =
"odf".freeze
PHP =
"php".freeze
PLAINXLIFF =
"plainxliff".freeze
PO =
"po".freeze
PO_MONO =
"po-mono".freeze
POXLIFF =
"poxliff".freeze
PROPERTIES =
"properties".freeze
PROPERTIES_UTF16 =
"properties-utf16".freeze
PROPERTIES_UTF8 =
"properties-utf8".freeze
RC =
"rc".freeze
RESOURCEDICTIONARY =
"resourcedictionary".freeze
RESX =
"resx".freeze
RUBY_YAML =
"ruby-yaml".freeze
SRT =
"srt".freeze
SSA =
"ssa".freeze
STRINGS =
"strings".freeze
STRINGS_UTF8 =
"strings-utf8".freeze
STRINGSDICT =
"stringsdict".freeze
SUB =
"sub".freeze
TBX =
"tbx".freeze
TS =
"ts".freeze
TXT =
"txt".freeze
WEBEXTENSION =
"webextension".freeze
XLIFF =
"xliff".freeze
XLSX =
"xlsx".freeze
XWIKI_FULLPAGE =
"xwiki-fullpage".freeze
XWIKI_JAVA_PROPERTIES =
"xwiki-java-properties".freeze
XWIKI_PAGE_PROPERTIES =
"xwiki-page-properties".freeze
YAML =
"yaml".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



82
83
84
# File 'lib/weblate/models/file_format_enum.rb', line 82

def self.all_vars
  @all_vars ||= [APPSTORE, ARB, ARESOURCE, ASS, CSV, CSV_MULTI_UTF_8, CSV_SIMPLE, CSV_SIMPLE_ISO, CSV_SIMPLE_UTF_8, CSV_UTF_8, DOKUWIKI, DTD, FLATXML, FLUENT, FORMATJS, GO_I18N_JSON, GO_I18N_JSON_V2, GOTEXT, GWT, GWT_ISO, HTML, I18NEXT, I18NEXTV4, IDML, INI, ISLU, JOOMLA, JSON, JSON_NESTED, LARAVEL, MARKDOWN, MEDIAWIKI, MI18N_LANG, MOKO_RESOURCE, ODF, PHP, PLAINXLIFF, PO, PO_MONO, POXLIFF, PROPERTIES, PROPERTIES_UTF16, PROPERTIES_UTF8, RC, RESOURCEDICTIONARY, RESX, RUBY_YAML, SRT, SSA, STRINGS, STRINGS_UTF8, STRINGSDICT, SUB, TBX, TS, TXT, WEBEXTENSION, XLIFF, XLSX, XWIKI_FULLPAGE, XWIKI_JAVA_PROPERTIES, XWIKI_PAGE_PROPERTIES, YAML].freeze
end

.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



89
90
91
# File 'lib/weblate/models/file_format_enum.rb', line 89

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



96
97
98
99
# File 'lib/weblate/models/file_format_enum.rb', line 96

def build_from_hash(value)
  return value if FileFormatEnum.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #FileFormatEnum"
end