summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-09-28 12:13:43 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-09-28 12:13:43 -0700
commit5afbd2432372d0d137cd8ef579a1e73e6deb7d87 (patch)
tree0627599eda6bcd2903d94d5cba288fc7981abff0 /lib
parent1d0463ca1f63f84032b5b983962e59f88ff123a0 (diff)
downloadpsych-5afbd2432372d0d137cd8ef579a1e73e6deb7d87.zip
initial load is working
Diffstat (limited to 'lib')
-rw-r--r--lib/psych.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/psych.rb b/lib/psych.rb
index bdc2458..bbb8662 100644
--- a/lib/psych.rb
+++ b/lib/psych.rb
@@ -19,7 +19,11 @@ module Psych
VERSION = '1.0.0'
LIBYAML_VERSION = Psych.libyaml_version.join '.'
- def self.parse thing
- Psych::Parser.new.parse thing
+ ###
+ # Load +yaml+ in to a Ruby data structure
+ def self.load yaml
+ parser = Psych::Parser.new(TreeBuilder.new)
+ parser.parse yaml
+ parser.handler.root.children.first.to_ruby
end
end