Class: Transcoder::Yaml

Inherits:
Parser
  • Object
show all
Defined in:
lib/transcoder/parser/yaml/identifier.rb

Class Method Summary collapse

Class Method Details

.generate(objects) ⇒ Object

Raises:



12
13
14
15
# File 'lib/transcoder/parser/yaml/identifier.rb', line 12

def self.generate(objects)
  raise TypeError unless objects.is_a? Hash or objects.is_a? Array
  YAML.dump(objects)
end

.parse(raw) ⇒ Object



17
18
19
# File 'lib/transcoder/parser/yaml/identifier.rb', line 17

def self.parse(raw)
  YAML.load(raw)
end