Class: PhraseAppUpdater::LocaleFile::YAMLFile
Constant Summary
collapse
- EXTENSION =
"yml"
- PHRASEAPP_TYPE =
"yml"
Instance Attribute Summary
#content, #locale_name, #parsed_content
Class Method Summary
collapse
class_for_file_format, #filename, from_file_content, from_hash, load_directory, load_file, #to_s
Class Method Details
.dump(hash) ⇒ Object
15
16
17
|
# File 'lib/phraseapp_updater/locale_file/yaml_file.rb', line 15
def dump(hash)
Psych.dump(hash)
end
|
.extension ⇒ Object
19
20
21
|
# File 'lib/phraseapp_updater/locale_file/yaml_file.rb', line 19
def extension
EXTENSION
end
|
.load(content) ⇒ Object
9
10
11
12
13
|
# File 'lib/phraseapp_updater/locale_file/yaml_file.rb', line 9
def load(content)
Psych.load(content)
rescue Psych::SyntaxError => e
raise ArgumentError.new("Provided content was not valid YAML")
end
|
.phraseapp_type ⇒ Object
23
24
25
|
# File 'lib/phraseapp_updater/locale_file/yaml_file.rb', line 23
def phraseapp_type
PHRASEAPP_TYPE
end
|