summaryrefslogtreecommitdiff
path: root/lib/psych.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-01-26 23:11:09 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-01-26 23:11:09 -0800
commitb79d64dd0bf00c4092b798f8b993d2ba780cc868 (patch)
treed1c8c99d33a6c63a29e8a16a425af4520d20eb0d /lib/psych.rb
parent2fa4eb511d63d2f0c0924664c0eb646f76f4d9dd (diff)
downloadpsych-b79d64dd0bf00c4092b798f8b993d2ba780cc868.zip
classes can be emitted as scalar and map
Diffstat (limited to 'lib/psych.rb')
-rw-r--r--lib/psych.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/psych.rb b/lib/psych.rb
index cebc427..0c1ad22 100644
--- a/lib/psych.rb
+++ b/lib/psych.rb
@@ -7,6 +7,7 @@ require 'psych/parser'
require 'psych/omap'
require 'psych/set'
require 'psych/coder'
+require 'psych/yaml'
###
# = Overview
@@ -156,6 +157,19 @@ module Psych
def self.add_domain_type domain, type_tag, &block
@domain_types[type_tag] = [domain, block]
end
- class << self; attr_accessor :domain_types; end
+
+ @load_tags = {}
+ @dump_tags = {}
+ def self.add_tag tag, klass
+ @load_tags[tag] = klass
+ @dump_tags[klass] = tag
+ end
+
+ class << self
+ attr_accessor :load_tags
+ attr_accessor :dump_tags
+ attr_accessor :domain_types
+ end
+
# :startdoc:
end