{
    "mode": "ri",
    "parameter": "Psych::Parser",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/ri/Psych%3A%3AParser/json",
    "generated": "2026-06-02T15:57:01Z",
    "sections": {
        "Psych::Parser < Object": {
            "content": "(from gem psych-5.4.0)\n------------------------------------------------------------------------\n\nYAML event parser class.  This class parses a YAML document and calls\nevents on the handler that is passed to the constructor.  The events can\nbe used for things such as constructing a YAML AST or deserializing YAML\ndocuments.  It can even be fed back to Psych::Emitter to emit the same\ndocument that was parsed.\n\nSee Psych::Handler for documentation on the events that Psych::Parser\nemits.\n\nHere is an example that prints out ever scalar found in a YAML document:\n\n# Handler for detecting scalar values\nclass ScalarHandler < Psych::Handler\ndef scalar value, anchor, tag, plain, quoted, style\nputs value\nend\nend\n\nparser = Psych::Parser.new(ScalarHandler.new)\nparser.parse(yamldocument)\n\nHere is an example that feeds the parser back in to Psych::Emitter.  The\nYAML document is read from STDIN and written back out to STDERR:\n\nparser = Psych::Parser.new(Psych::Emitter.new($stderr))\nparser.parse($stdin)\n\nPsych uses Psych::Parser in combination with Psych::TreeBuilder to\nconstruct an AST of the parsed YAML document.\n------------------------------------------------------------------------",
            "subsections": []
        },
        "Constants:": {
            "content": "ANY:\nLet the parser choose the encoding\n\n\nUTF16BE:\nUTF-16-BE Encoding with BOM\n\n\nUTF16LE:\nUTF-16-LE Encoding with BOM\n\n\nUTF8:\nUTF-8 Encoding\n\n\n",
            "subsections": []
        },
        "Class methods:": {
            "content": "new\n",
            "subsections": []
        },
        "Instance methods:": {
            "content": "nativeparse\nexternalencoding\nhandler\nmark\nparse\n",
            "subsections": []
        },
        "Attributes:": {
            "content": "attraccessor handler\nattrwriter externalencoding\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}