# Autoload is fine, its apart of ruby-core.
autoload :YAML, "yaml"

module Transcoder
  class Yaml < Parser
    identifier "text/yaml",
               "text/x-yaml",
               "application/yaml",
               "application/x-yaml"
    
    def self.generate(objects)
      YAML.dump(objects)
    end
    
    def self.parse(raw)
      YAML.load(raw)
    end
  end
end
# Autoload is fine, its apart of ruby-core.
autoload :YAML, "yaml"

module Transcoder
  class Yaml < Parser
    identifier "yaml",
               "text/yaml",
               "text/x-yaml",
               "application/yaml",
               "application/x-yaml"
    
    def self.generate(objects)
      raise TypeError unless objects.is_a? Hash or objects.is_a? Array
      YAML.dump(objects)
    end
    
    def self.parse(raw)
      YAML.load(raw)
    end
  end
end
Raise a TypeError if not a hash or an array
Raise a TypeError if not a hash or an array