summaryrefslogtreecommitdiff
path: root/lib/psych/parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/psych/parser.rb')
-rw-r--r--lib/psych/parser.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/psych/parser.rb b/lib/psych/parser.rb
index 39bc828..2181c73 100644
--- a/lib/psych/parser.rb
+++ b/lib/psych/parser.rb
@@ -48,5 +48,18 @@ module Psych
@handler = handler
@external_encoding = ANY
end
+
+ ###
+ # call-seq:
+ # parser.parse(yaml)
+ #
+ # Parse the YAML document contained in +yaml+. Events will be called on
+ # the handler set on the parser instance.
+ #
+ # See Psych::Parser and Psych::Parser#handler
+
+ def parse yaml, path = yaml.respond_to?(:path) ? yaml.path : "<unknown>"
+ _native_parse @handler, yaml, path
+ end
end
end