diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-02-04 23:11:58 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-02-04 23:11:58 -0800 |
commit | 2af19a1e54678beba6e107400fc2b34b7350354e (patch) | |
tree | c354095858373b01e0a69a151fb17ae17f8191d9 /lib | |
parent | 785d44b0e5cc477e8586b927d7125ebbc0964355 (diff) | |
download | psych-2af19a1e54678beba6e107400fc2b34b7350354e.zip |
adding load_file method
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/psych.rb b/lib/psych.rb index 0c1ad22..eefa99a 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -152,6 +152,13 @@ module Psych end end + ### + # Load the document contained in +filename+. Returns the yaml contained in + # +filename+ as a ruby object + def self.load_file filename + self.load File.read(filename) + end + # :stopdoc: @domain_types = {} def self.add_domain_type domain, type_tag, &block |